DataGridView查询的问题
DataGridView
绑定到BindingSource,表SAN 数据库MYSAN
我想通过 按钮 和TEXTBOX 查询 表中 Sname 那一行,显示并且选中那一行(主要之后可以用BindingSource.Current)
我只要代码~~
为了交作业的菜鸟,鄙视我吧!
[解决办法]
Me.DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
dim cmdstr as string
cmdstr="SQL语句"
sqlcmd.Connection = sqlcnn
sqlcmd.CommandText = cmdstr
sqladp.Fill(table)
Me.DataGridView1.DataSource = table
Me.DataGridView1.Update()
Me.DataGridView1.Refresh()