DataAdapter.Update();
SqlCommand.ExecuteNonQuery();
SqlCommand.ExecuteReader();
.....
SqlCommand.ExecuteNonQuery();
SqlCommand.ExecuteReader();
.....
解决方案 »
- 要用ASP.NET做一个杂志出版的网站,其中存在的问题?请各位帮帮忙。
- 关于updatepanel的问题
- 发邮件脚本问题
- GridView和CheckBox的问题
- 求助
- 请高人帮忙看看这段程序哪儿有问题? 急!!
- 运行WEB后,在服务器端运行了一个ASPNET_WP.EXE的进程,关闭WEB,进程却不退出,占用资源.怎么退出进程啊?
- asp.net中打印控件为什么是白色的,不能使用?
- 急切求 最新版本的 Rational Rose ,好心的兄弟,大姐,妹子,给俺发一个吧,我的msn:[email protected]
- 如何得到某一字符串的宽和高?
- DataReader查询结果为空时,绑定到label上时出错!!!!
- 我初学asp.net,请问如何建立一个ascx文件?谢谢!
string newpe=per.Text;
SqlConnection conn =new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
string comm="SELECT PersonID,PersonEmail FROM Person";
SqlDataAdapter ada=new SqlDataAdapter(comm,conn);
SqlCommandBuilder sc=new SqlCommandBuilder(ada);
DataSet ds=new DataSet();
ada.Fill(ds,"Person");
DataTable titlesTable=ds.Tables["Person"];
int pid=(int)authorsGrid.DataKeys[e.Item.ItemIndex];
DataRow[] rows=titlesTable.Select("personID='" + pid + "'");
DataRow editrow = rows[0];
editrow.BeginEdit();
editrow["PersonEmail"]=newpe;
editrow.EndEdit();
ada.Update(ds,"Person");
editrow.AcceptChanges();
conn.Close();
authorsGrid.EditItemIndex=-1;