如何把textbox中的内容插入数据库中
可能这个问题很幼稚,请大家请教了!
------解决方案--------------------呵呵 真不好意思 没认真
string AnnouncementTypeID = TextBox1.Text;
string Name = TextBox2.Text;
string SQL = "insert into [Announcement_Information](AnnouncementTypeID,Name) values( ' " + AnnouncementTypeID + " ', ' " + Name + " ') ";
SqlConnection myConn = new SqlConnection( "server=JAMES_CUI;database=LivePortal_WorkFlow;uid=sa;pwd=sa; ");
SqlCommand mySqlCommand = new SqlCommand(SQL, myConn);
mySqlCommand.CommandType = CommandType.Text
mySqlCommand.ExecuteNonQuery();
------解决方案--------------------SqlConnection conn = new SqlConnection( "server=127.0.0.1;uid=sa;pwd=sa;database=a ");