---------------------------------------------------------------------------------------------------

*SQLConnect*
string ConnString="server=localhost; uid=sa; pwd=; database=Employee";//连接数据库字符串
string UpdataQuery="update Emp set ID='M009' where Name='西西'";//SQL语句字符串
SqlConnection Sqlcon=new SqlConnection(ConnString);//创建一个连接
SqlCommand Sqlcom=new SqlCommand(UpdataQuery,Sqlcon);//通过SqlCommand执行SQL命令
Sqlcon.Open();//打开连接
Sqlcom.ExecuteNonQuery();//执行SQL语句的操作
Sqlcon.Close();//关闭连接
---------------------------------------------------------------------------------------------------

相关文章:

  • 2021-09-30
  • 2022-01-23
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-12
  • 2021-11-05
  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2021-09-01
相关资源
相似解决方案