2. How do I Insert data collected from text box to sql server table?
using c# in vs 2008
You should fetch the value from textbox and do with the help of SqlCommand——
【Sample】
using(SqlCommand cmd = new SqlCommand("insert into TableName(Column1,Column2,……,ColumnN)values(@column1,@column2,……,@columnN"),new SqlConnection("…………"))
{
cmd.Connection.Open();
cmd.Parameter.AddWithValue("@column1",textbox1.Value);
………………
cmd.ExecuteNonQuery();
}
QQ我:
下载MSDN桌面工具(Vista,Win7)
我的博客园
慈善点击,点击此处