从数据库中获取数据并对其进行修改。 [英] fetch data from Database and Modify it.

查看:108
本文介绍了从数据库中获取数据并对其进行修改。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的编码员,



我通过执行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

推荐答案

看看这里:

http:// msdn.microsoft.com/en-us/library/safa4957.aspx [ ^ ]


这篇关于从数据库中获取数据并对其进行修改。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆