VB.NET的datagridview的用法,求助高手!
我刚刚学,我做了一个FORM,里面有一个按钮,还有一个DATAGRIDVIEW控件, 然后,按钮中的代码如下:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strCon As String = "Server=127.0.0.1;Initial Catalog=jmgl;Persist Security Info=True;User ID=sa;Password=hua1234; "
'Dim strcon As New SqlClient.SqlConnection("data source=(127.0.0.1);initial catalog=TEST;user id=sa;pwd=")
Dim conn As SqlConnection
conn = New SqlConnection(strCon)
Dim str_cmd As String = "select id,idate,itemid,itemtype,unit,boxid,color from jm_item order by itemid"
Dim da As New SqlClient.SqlDataAdapter
da.SelectCommand = New SqlClient.SqlCommand(str_cmd, conn)
Dim mydataset As New DataSet
da.Fill(mydataset)
DataGridView1.DataSource = mydataset.Tables(0)
DataGridView1.Enabled = True
conn.Close()
conn.Dispose()
END SUB
现在,点击查找按钮时,则数据可以在DATAGRIDVIEW控件中显示出来记录, 现在我想在FORM上添加一个"修改"按钮, 那么,请问我如何可以对DATAGRIDVIEW中的值修改后,点那个"修改"按钮,则提示保存OK呢? 我刚刚学,不知如何在修改按钮中写代码,麻烦高手指教一下,谢谢(注:我的DATAGRIDVIEW 是通过查找出来的记录临时绑定的).
等待高人指点!