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
但我不知道转换的函数是什么
如果是时间的传递,建议加入DateTimePicker控件,这样好进行转换点.在时间的输入上也方便点
具体代码如下:(必须加入DateTimePicker控件,该值是DateTimePicker的选择结果)
& DateTimePicker1.Value.Date &
这样就没错了
楼主,你好:
有个问题帮我解决下,谢谢了
我想用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
asp.net的模块应该有人能回答这个问题,我对asp.net了解不是很深!~请谅解!
不错