public void CreateMySqlCommand()
{
status.text:="正在查詢中,請稍候!";
//status就是頁面中間的一個標簽,其實也簡單,這裡加上就行了
SqlConnection myConnection = new SqlConnection("Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=mySQLServer");
myConnection.Open();
SqlTransaction myTrans = myConnection.begin
Transaction();
string mySelectQuery = "SELECT * FROM Categories ORDER BY CategoryID";
SqlCommand myCommand = new SqlCommand(mySelectQuery, myConnection,myTrans);
myCommand.CommandTimeout = 20;
status.text:="查詢結束!";
}