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

问题描述

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.

推荐答案



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

10-16 21:19