Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have the bellow code in a formview why is it saying incorrect when I have the label already
conn2.Update("INSERT INTO test (QuestionNumber, Answer) VALUES ('" + lblquestnum.Text + "', 1)");
Posted
Comments
Mahesh_Bhosale 29-Mar-13 8:35am    
hay friends i can't get your question
can you explain in brief?
joanne danastasi 29-Mar-13 8:50am    
I have a form in a form view I am displaying the contents using the data source on clicking the next button I want that the contents of the label in the form view to be stored in a database table
[no name] 29-Mar-13 8:57am    
You need to improve your question with a bit more of your code and the exact error message.
joanne danastasi 29-Mar-13 9:43am    
I am creating a formview in microsoft viusal studio I have successfully connected the database
and display the information in labels and radiobutton. on clicking next I am updating the table but I want to take the data from a label in the form view using the code below
conn2.Update("INSERT INTO test (QuestionNumber, Answer) VALUES ('" + lblquestnum.Text + "', 1)");

and I am given this error The name 'lblquestnum' does not exist in the current context
Richard C Bishop 29-Mar-13 10:00am    
That error means your "lblquestnum" does not exist or is out of scope if you created it dynamically.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900