DataAdapter.Update() does not Update the Database

后端 未结 9 2031
庸人自扰
庸人自扰 2020-12-16 16:10

I\'m sure there is an extremely simple reason that this one line isn\'t working, but it has evaded for the past week, so I\'m hoping someone else will notice my fault.

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-16 17:10

    What does the SqlCommand for Update look like? I see the command but I don't see any SqlText, that's what you're missing.

    You need to define what .Update does by setting .UpdateCommand property on the SqlDataAdapter

    This link gives a pretty good breakdown on how to go about it: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter.updatecommand.aspx

提交回复
热议问题