另外你的修改记录的代码建议你仔细的检查sql语句
可以先在sql查询分析器里检查是否能修改.
爱上思考,爱上编程,爱上.net!
在一个TEXTBOX1.TEXT中输入日期以后通过查询在DATAGRID中显示,可我的怎么显示不出来啊
Dim conn As New SqlConnection
conn.ConnectionString = ConfigurationSettings.AppSettings("aa")
Dim cmd As New SqlCommand
Dim dr As New SqlDataAdapter
Dim ds As New DataSet
conn.Open()
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 & "'"
cmd.Connection = conn
cmd.CommandType = CommandType.Text
dr.SelectCommand = cmd
dr.Fill(ds, "info")
DataGrid1.DataSource = ds.Tables("info")
DataGrid1.DataBind()
conn.Close()
[此贴子已经被作者于2006-5-16 21:28:54编辑过]