获取列值的问题!!
我想获取表中字段也就是列的值,但获取的却是字段名各位帮我看一下这段程序哪儿错误了啊,谢谢!
Sub mydatabind()
Dim conn As New SqlConnection("server=(local);database=xf;uid=sa;pwd=;")
Dim newid As String = Request.QueryString("nid")
Dim strsql As String = "select * from news where nid='" & newid & "'"
Dim cmd As New SqlCommand(strsql, conn)
Dim adp As New SqlDataAdapter(cmd)
Dim ds As New DataSet
adp.Fill(ds, "news")
TextBox1.Text = ds.Tables(0).Columns(0).ToString
TextBox2.Text = ds.Tables(0).Columns(1).ToString
TextBox3.Text = ds.Tables(0).Columns(2).ToString
TextBox4.Text = ds.Tables(0).Columns(3).ToString
End Sub