为了访问SQL Server 2005某数据表并且更新一些内容,我先用一个SqlConnection与数据库建立连接,然后用一个SqlDataAdapter数据适配器,再用一个DataSet加一个DataTable,得到了一个数据集,比如说15条内容吧,现在问题是,我把这15条的某些字段更新后,怎么写回到数据表中去?一个一个的UpData()吗?有没有一次把15条写入的办法呀?真头疼,那位高人助我一下!
调试欢乐多
string sql="udpate Table set ziduan=.. where..";
conn.Open();
SqlCommand cmd=new SqlCommand(sql,conn);
try
{
cmd.ExecuteNonQuery();
}
finally{conn.Close();}