cmd.CommandText = "select u_id as 编号,u_name as 姓名,u_sex as 性别,u_indate as 入学时间,u_zhy as 所学专业,u_dw as 所在单位 from info where u_indate='" & TextBox1.Text & "'"
因为在数据库中u_indate的属性是datatime
但我不知道转换的函数是什么
楼主,你好:
有个问题帮我解决下,谢谢了
我想用TREEVIEW做一个二层的树形菜单,就如CSDN本论坛的导行栏一样,但结点随时更新,只能从数据库里分类加载,下面是我加载根结点的代码,运行成功!
但不知怎么分类加载子结点?
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim dtr As System.Data.OleDb.OleDbDataReader
Dim cmd As System.Data.OleDb.OleDbCommand
TreeView1.Nodes.Clear()
cmd = New OleDb.OleDbCommand("select * from title", OleDbConnection1)
OleDbConnection1.Open()
dtr = cmd.ExecuteReader()
Dim n As Integer
While dtr.Read()
If dtr.GetBoolean(2) = True Then
TreeView1.Nodes.Add(New TreeNode(dtr.GetString(1)))
End If
End While
dtr.Close()
OleDbDataAdapter1.Fill(DataSet11)
OleDbConnection1.Close()
End Sub