sqlConnection.Open();
sqlCommand.ExecuteNonQuery();
//you can use reader here,too.as long as you modify the sp and let it like select * from ....
sqlCommand.Dispose();
sqlConnection.Close();
}
public void UseSqlDataSet()
{
SqlConnection sqlConnection = new SqlConnection(sqlConnectionCommand);
SqlCommand sqlCommand = new SqlCommand();
sqlCommand.CommandType = System.Data.CommandType.Text;
sqlCommand.Connection = sqlConnection;
sqlCommand.CommandText = sqlSelectCommand;
sqlConnection.Open();
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter();
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/