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 ???

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

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.