我是一个好人,所以我不要求您“立即答复" ... [英] I'm a kind guy, so I don't ask you to "Reply Immediately"...

查看:108
本文介绍了我是一个好人,所以我不要求您“立即答复" ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dim cbu As New SqlCommandBuilder
   Dim ds As DataSet
   Dim adp As SqlDataAdapter
   Dim cmd As SqlCommand
cmd = New SqlCommand("select * from CurrentLiabilities", constr)
adp = New SqlDataAdapter(cmd)
ds = New DataSet()
cbu.DataAdapter = adp
adp.InsertCommand = cbu.GetInsertCommand     
adp.UpdateCommand = cbu.GetUpdateCommand     ' error
adp.DeleteCommand = cbu.GetDeleteCommand

  adp.Fill(ds, "CurrentLiabilities")

Me.DataGridView1.DataSource = ds
Me.DataGridView1.DataMember ="CurrentLiabilities"

 conObj.con.Close()



错误:不返回任何键列信息的SelectCommand不支持动态生成UpdateCommand.



error : Dyanmic generation for the UpdateCommand is not supported against the SelectCommand that does not return any key column information.

推荐答案

您必须为CurrentLiabilities表创建主键
You have to create a primary key for CurrentLiabilities table


学会礼貌!您在这里寻求帮助.

人们有空时会提供帮助.
1.您需要保持耐心以获得答案
2.要有礼貌,不要要求以获得快速解答.

现在,
您的错误是不言自明的.你读过它吗?您需要包括现在丢失的键列.
Learn to have some courtesy! You are asking for help here.

People help when they are free.
1. You need to keep patience for answer
2. Be polite and don''t demand for quick answers.

For now,
your error is quite self-explanatory. Did you read it? You need to include the key column that you are missing right now.


这篇关于我是一个好人,所以我不要求您“立即答复" ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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