日期:2014-05-17 浏览次数:20417 次
string queryString = "insert into Terminals (Id, Name) values (@id, @name)";
StringBuilder errorMessages = new StringBuilder();
using (SqlConnection connection = new SqlConnection(connectionString)) {
SqlCommand command = new SqlCommand(queryString, connection);
command.Parameters.Add(new SqlParameter("@id", "1"));
command.Parameters.Add(new SqlParameter("@name", "name 1"));
connection.Open();
}