首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

DataGridView查询的有关问题

2012-03-27 
DataGridView查询的问题DataGridView绑定到BindingSource,表SAN 数据库MYSAN我想通过 按钮 和TEXTBOX查询

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()

热点排行