SqlConnection Conn = new SqlConnection("Server=localhost;DataBase=Northwind;Integrated Security =SSPI"); //建立数据库实例..
Conn.Open(); //打开数据库
SqlCommand Cmd = new SqlCommand();
Cmd.CommandText = "Insert into database(stuid,stuname) values('333','purana')";
Cmd.Connection = Conn;
Cmd.ExecuteNonQuery(); //执行sql语句...
Conn.Close();
//更新使用Update..删除使用Delete语句...就可以...