*SQLConnect SQLServer2000数据库连接*

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

*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();//关闭连接
---------------------------------------------------------------------------------------------------

原文地址:https://www.cnblogs.com/dwjaissk/p/341902.html