上数据库的课程布置的大作业。第一次用vs2013,需要开发一个用户交互界面,网上搜了很多内容看的一知半解。下面的代码可以达到按button在窗体上显示系号为10 的学生信息,我想让这个10变成后面textbox里输入的内容,代码应该怎么写。跪求各位大神指点。
Imports System.Data.SqlClient
Public Class Form1
Dim cn As SqlConnection
Dim da As SqlDataAdapter
Dim ds As DataSet
Dim cnStr As String = "Data source=(local);Initial Catalog=wuxiang;Integrated Security=False;User ID=sa;Password=19960318yang;"
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
cn = New SqlConnection(cnStr)
da = New SqlDataAdapter("select*from student where deptno=10", cn)
ds = New DataSet()
da.Fill(ds, "student")
DataGridView1.DataSource = ds.Tables("student")
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
End Sub
End Class