如何知道以下INSERT
查詢是否成功?如何知道查詢是否成功?
MySqlConnection connection = new MySqlConnection(ConnectionString);
connection.Open();
MySqlCommand command = new MySqlCommand("INSERT INTO People (PersonName, dateAdded) VALUES (?name, NOW())", connection);
command.Parameters.Add(new MySqlParameter("name", Name));
MySqlDataReader Reader = command.ExecuteReader();
我試圖運行Reader.Read()
但只返回一個空字符串。謝謝。
謝謝,這看起來是我需要的! – dotancohen 2012-03-07 19:17:38