表格插入列
我想在 建好的表格中 插入一列 用命令 怎么实现呀
2010-08-17 23:00
2010-08-18 01:01
2010-08-18 05:48
程序代码://在数据表中添加数据列
string MySQL = "ALTER TABLE 商品清单 ADD [检验员] [varchar] ([color=#800000; font-weight: bold]50[/color]) NULL;";
SqlConnection MyConnection = new SqlConnection("Data Source = .;Database = MyDatabase;Integrated Security=SSPI");
SqlCommand MyCommand = new SqlCommand(MySQL, MyConnection);
try
{
MyCommand.Connection.Open();
MyCommand.ExecuteNonQuery();
MessageBox.Show("成功在“商品清单”数据表中添加数据列", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
MyConnection.Close();
}

2010-08-18 08:22
2010-08-20 10:43