在设计期间修改了OleDbCommand类的CommandText属性后, 系统会提示是否更新Parameters,请问如何用代码实现自动更新参数这一功能

chenhaipeng 2003-08-22 09:03:16
在设计期间修改了OleDbCommand类的CommandText属性后, 系统会提示是否更新Parameters,请问如何用代码实现自动更新参数这一功能?

谢谢!
...全文
113 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenhaipeng 2003-08-23
  • 打赏
  • 举报
回复
up
chenhaipeng 2003-08-22
  • 打赏
  • 举报
回复
我的UpdateCommand的CommandText是在我的代码中动态生成的,含有参数.
由于我的SelectCommand里的SQL语句里面来自多个表,又不可以用CommandBuilder的GetUpdateCommand方法来获取,

我该如何自动生成参数呢?
saucer 2003-08-22
  • 打赏
  • 举报
回复
if you are using straight SQL and CommandBuilder, then don't worry about it, CommandBuilder will do the right thing

if you are using a stored procedure, call CommandBuilder's DeriveParameters method on your Command object to refresh the parameter collections
panyee 2003-08-22
  • 打赏
  • 举报
回复
自己写sql语句

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧