当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > 使用CommandBuilder为DataAdaper生成的Command更新数据源时的注意事项!

ASP.NET
Web服务器控件:LinkButton控件
Web服务器控件:ListBox控件
Web服务器控件:ListItem控件
Web服务器控件:Literal控件
Web服务器控件:Panel控件
Web服务器控件:PlaceHolder控件
Web服务器控件:RadioButton控件
Web服务器控件:RadioButtonList控件
Web服务器控件:BulletedList控件
Web服务器控件:Style控件
Web服务器控件:Table控件
Web服务器控件:TableCell控件
Web服务器控件:TableRow控件
Web服务器控件:TextBox控件
Web服务器控件:XML控件
Validation服务器控件:CompareValidator控件
Validation服务器控件:CustomValidator控件
Validation服务器控件:RangeValidator控件
Validation服务器控件:RegularExpressionValidator控件
Validation服务器控件:RequiredFieldValidator控件

ASP.NET 中的 使用CommandBuilder为DataAdaper生成的Command更新数据源时的注意事项!


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 183 ::
收藏到网摘: n/a


1.SelectCommand使用的select命令中必须包含主键(primary key)!
2.填充数据集时,使用如下方法:
da.FillSchema(ds,SchemaType.Source, "TableName"); //加载表架构 注意
da.Fill(dsPubs,"TableName"); //加载表数据
3. DataAdapter 的 MissingSchemaAction 属性设置为 AddWithKey
4.构造CommandBuilder对象时,将DataAdapter对象作为构造函数参数传入:
SqlCommandBuilder objCommandBuilder = new SqlCommandBuilder(da);5.增加行,修改行,删除行;6.调用DataAdapter的update方法更新数据源!7.更新数据源成功,调用ds的Acceptchanges()方法,更新数据集!