updatecommand 和deletecommand

yanpengtao 2010-05-18 11:01:06
小弟在添加TableAdapter时 添加好了以后 在右边的属性栏里没有updatecommand 和deletecommand !!主键已经设置了
...全文
46 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
捷哥1999 2010-05-18
  • 打赏
  • 举报
回复
捷哥1999 2010-05-18
  • 打赏
  • 举报
回复
你用sqldataadapter!
Insert和Delete方法是TableAdapter直接提供的。
C# oracle 类 事务处理 #region 公有方法 public void JoinTransaction(Transaction transaction) { if (this._transaction != null) { throw new Exception("对象已经在另一个事务中"); } else { this._transaction = transaction.DataBaseTransaction; } } public void QuitTransaction() { if (this._transaction != null) { // 确保_dataAdapter对象的各命令的连接不是事务的连接,以免Dispose _dataAdapter对象时,意外关闭事务的连接。 if (this._dataAdapter != null) { if (this._dataAdapter.SelectCommand != null) { if (this._dataAdapter.SelectCommand.Connection != null) if (this._dataAdapter.SelectCommand.Connection.Equals(this._transaction.Connection)) this._dataAdapter.SelectCommand.Connection = null; } if (this._dataAdapter.InsertCommand != null) { if (this._dataAdapter.InsertCommand.Connection != null) if (this._dataAdapter.InsertCommand.Connection.Equals(this._transaction.Connection)) this._dataAdapter.InsertCommand.Connection = null; } if (_dataAdapter.UpdateCommand != null) { if (this._dataAdapter.UpdateCommand.Connection != null) if (this._dataAdapter.UpdateCommand.Connection.Equals(this._transaction.Connection)) this._dataAdapter.UpdateCommand.Connection = null; } if (_dataAdapter.DeleteCommand != null) { if (this._dataAdapter.DeleteCommand.Connection != null) if (this._dataAdapter.DeleteCommand.Connection.Equals(this._transaction.Connection)) this._dataAdapter.DeleteCommand.Connection = null; } } //确保本对象的连接不是事务的连接,以免本对象Dispose时,意外关闭事务的连接。 if (this._connection != null) { if (this._connection.Equals(this._transaction.Connection)) this._connection = null; } // this._transaction = null; } } #endregion

110,534

社区成员

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

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

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