怎样用代码增加一个列
private void button1_Click(object sender, EventArgs e){
SqlConnection conn = new SqlConnection("server=a;user=a;pwd=a;database=a");
conn.Open();
string str_alter = "alter table dbo.contact add '" + textBox1.Text + "' varchar(100)";
SqlCommand comm = new SqlCommand(str_alter, conn);
这里的代码该怎样写?
MessageBox.Show("添加成功");
}
[ 本帖最后由 寒水1015 于 2009-11-6 21:56 编辑 ]