using System; using System.Data; using System.Data.SqlClient; static void Main(){ String connStr="driver=(local);user id=sa;password=111111;database=test"; using(SqlConnection conn=new SqlConnection()){ String strSQL="update userlist set password=111111"; using(SqlCommand comm=new SqlCommand(strSQL,conn)){ comm.executeUpdate(strSQL); } } }