Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to transfer data from one form to another in winforms c#?
    primarykey
    data
    text
    <ol> <li>I want to create at 5-6 forms in windows application to insert data.</li> <li>Each form contain at-least 15-20 Controls. All Forms Belongs to different table. But some with same. </li> <li>I have to created stored "Next"named button on each form, such that when i click on next button all the information filled on that button get store some where<br> and in this way after storing the information on the last button where a Submit button is dragged, on clicking on that submit button all the data got saved into the data base.</li> <li>Please tell me how can i store the data inserted on previous forms and call it on click event of submit button.</li> </ol> <p>For now i am having all the controls on the same page and i have used these codes for insertion.</p> <pre><code> private void submit_addbtn_Click(object sender, EventArgs e) { try { //personal data insert Personal per = new Personal(); per.Name = nametxt.Text; per.FatherName = f_nametxt.Text; per.MotherName = m_nametxt.Text; per.Gotra = gotra_txt.Text; per.Panth = panthcb.Text; per.FamilyHead = fhntext.Text; per.Educationlvl = edulvlcb.Text; per.Education = educb.Text; per.Blood = bloodcb.Text; per.Gender = genderlist.Text; per.Marrital = MarritalStatus; per.DateOfBirth = dobdtp.Text; if (new InsertAction().Insertpersonal(per)) { MessageBox.Show("Personal Insertion Happen "); } else { MessageBox.Show(" Personal Insertion does not Happen "); } // spouse data insert Spouse sps = new Spouse(); sps.Spousename = s_nametxt.Text; sps.Spouseeducationlvl = s_edulvlcb.Text; sps.Spouseeducation = s_educb.Text; sps.Spouseblood = s_bgcb.Text; sps.Spousedob = s_dobdtp.Text; if (new InsertAction().Insertspouse(sps)) { MessageBox.Show(" Spouse Insertion Happen "); } else { MessageBox.Show(" Spouse Insertion does not Happen "); } // Resident data insert Ressident resi = new Ressident(); resi.RessiHnumber = ressi_numtxt.Text; resi.RessihCmplx = ressi_complextxt.Text; resi.RessiStrt = ressi_streettxt.Text; resi.RessiLandmrk = ressi_landtxt.Text; resi.RessiArea = ressi_areatxt.Text; resi.RessiCity = ressi_citytxt.Text; resi.RessiPhone = Convert.ToInt64(ressi_phnotxt.Text); resi.RessiMobile = Convert.ToInt64(mobi_notxt.Text); if (new InsertAction().Insertressident(resi)) { MessageBox.Show(" Ressident Insertion Happen "); } else { MessageBox.Show(" Ressident Insertion does not Happen "); } //occupation data insert Occupation ocp = new Occupation(); ocp.Occuptype = occup_typetxt.Text; ocp.Occupadd = office_addresstxt.Text; ocp.Occupnature = occup_naturecb.Text; ocp.Occupphone = Convert.ToInt64(office_phno1txt.Text); ocp.Occupmobile = Convert.ToInt64(office_mobnotxt.Text); if (new InsertAction().Insertoccupation(ocp)) { MessageBox.Show(" Occupation Insertion Happen "); } else { MessageBox.Show(" Occupation Insertion does not Happen "); } } </code></pre> <p>Please Help me. Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload