954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to acess textbox in form2 from form1 without storing it

how I am new to c# and I have a question

I have to create a form, it is of 2 pages so I created 2 different forms, now based on the database table, I have to fill few textboxes in form2 in order to overcome the exception of crashing as there are relationship between various tables.

My question is I need to write a code which denotes the textboxes in form1 when I click on the button on form 2 that saves all the values to the database.

I tried with this code but it did not work
form2 otherForm = new form2();
int tb = otherForm.TextBox6.Text;

can anybody help me on this ???

addie20
Newbie Poster
4 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

i didnt really get ur question .So what u r trying to do is to fill some info in a text box which is in form 1 and then when u press button u ll go to form 2 and now when u press button in form 2 the text box info from text box 1 should get inserted in databse.Let me know if I am right

sadhawan
Light Poster
41 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

ya thats wat I want, When i click the button in Form2 , I want textbox from both form 1 and form 2 to get into the database(SQL)..

Thank you

addie20
Newbie Poster
4 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

when u ll click submit on first form the values in the text box will have to go somewhereor the second option is to create a text box in second form that will get the value from first form and then u can submit them together.

sadhawan
Light Poster
41 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: