我正在使用文本框,textbox1 接受现有字段的值,textbox2 接受新字段名称。当我单击按钮时,我在 d/b 的 textbox1 中输入的相应字段名称应更改为在 textbox2 中输入。
protected void Button1_Click(object sender, EventArgs e) { //str = "sp_RENAME 'book.author','Au_Name','COLUMN'";
str = "sp_RENAME 'book.'" + TextBox1.Text + "','" + TextBox2.Text + "','COLUMN'";
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog= Library;Integrated Security=true");
con.Open();
SqlCommand cmd = new SqlCommand(str, con);
SqlDataReader dr = cmd.ExecuteReader();
//("SELECT * FROM IMSLogin WHERE Uname = '" + Uname + "' AND PWD= '" + pwd + "'", con)
}
非常感谢,
提前致谢!!