Hi!,
How can i store my button text stored into my database using sql server 2005 ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Aug 29, 2011, 2:10 PM
VulpesPosted Aug 30, 2011, 4:58 AM
Unless you're worried about losing votes if there's a system failure, there's no need to update the database every time a vote is cast but you can do so if you wish.
Black DiamondPosted Aug 30, 2011, 12:00 AM
Black DiamondPosted Aug 29, 2011, 1:39 PM
Poppa WallacePosted Aug 29, 2011, 1:27 PM
Black DiamondPosted Aug 29, 2011, 12:58 PM
string strSQL = "INSERT INTO Test (Test)" + " VALUES ('" + tn.Text.Replace(" ", "") + "')";
SqlCommand cmd = new SqlCommand(strSQL,this.sqlConnection1);
What is this.sqlConnection1?, is that my sql connection?
I got an error in this.sqlConnection1.
Poppa WallacePosted Aug 29, 2011, 12:23 PM
SqlCommand cmd = new SqlCommand(strSQL,this.sqlConnection1);
Poppa WallacePosted Aug 29, 2011, 12:08 PM
Button btn = (Button) sender;
//your sql data = btn.Text.Replace(" ", "");