1. 程式人生 > >C#using 用法

C#using 用法

void ExecuteCommand( string connString, string commandString ) { SqlConnection myConnection = new SqlConnection( connString ); SqlCommand mySqlCommand = new SqlCommand( commandString, myConnection ); myConnection.Open(); mySqlCommand.ExecuteNonQuery(); mySqlCommand.Dispose( ); myConnection.Dispose( ); }