从数据库中获取数据并对其进行修改。

从数据库中获取数据并对其进行修改。

问题描述:

亲爱的编码员,



我通过执行Query来管理从数据库中获取数据到datagridview甚至文本框,但是当我习惯修改或编辑它时实际上并没有起作用。我使用绑定导航器中的保存按钮来保存更改。但它不起作用。请帮我解决这个问题。



这是代码。



Dear Coders,

I Managed to fetch data from the database to the datagridview or even the textboxes by executing Query but when i used to modify or edit it it is not not actually working. I Used the Save button in the binding Navigator to save the changes. But Its not working. Please Help me out on this.

Here is the code.

Dim con As New SqlConnection
Dim myconstring As String = "Data Source=ETA-TESTSRVR;Initial Catalog=Procurement;Integrated Security=True"
con.ConnectionString = myconstring
Dim da As New SqlDataAdapter("SELECT * from E1 where mat_sub_no ='" + ComboBox1.SelectedValue + "'", con)
Dim dt As New DataTable
da.Fill(dt)
DataGridView1.DataSource = dt.DefaultView