会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
成长的足迹.NET
我的.NET成长之路
博客园
首页
新随笔
联系
订阅
管理
LoadDataRow应用例子
public
void
ExecuteInsert()
{
SqlConnection con
=
new
SqlConnection(
"
server=(local);uid=sa;pwd=sa;database=HljCost
"
);
SqlDataAdapter da
=
new
SqlDataAdapter(
"
SELECT * FROM [Manager]
"
,con);
da.MissingSchemaAction
=
MissingSchemaAction.AddWithKey;
SqlCommandBuilder cb
=
new
SqlCommandBuilder(da);
DataSet ds
=
new
DataSet();
da.Fill(ds);
DataRow dr
=
ds.Tables[
0
].NewRow();
dr[
"
MID
"
]
=
0
;
dr[
"
MuserID
"
]
=
2
;
dr[
"
Mpass
"
]
=
3
;
dr[
"
Type
"
]
=
1
;
ds.Tables[
0
].BeginLoadData();
ds.Tables[
0
].LoadDataRow(dr.ItemArray,
false
);
ds.Tables[
0
].EndLoadData();
this
.Response.Write(da.Update(ds.Tables[
0
]));
}
posted @
2007-11-22 15:27
ejiyuan
阅读(
1753
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
公告