Tahir Ansari

Tahir Ansari

  • 254
  • 7.5k
  • 187.7k

Need suggestion, I am converting webform to asp.net mvc ado.net jquery

Jan 13 2023 7:21 AM

Hi Engineers,

i have webform application where all values are inserted through different store dprocedures and multiple paramters

SqlCommand cmd = new SqlCommand("Proc_insert_Offer_letter", con); 
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@company", SqlDbType.VarChar, 200).Value = ddlcompany.SelectedItem.Text;
cmd.Parameters.Add("@verti", SqlDbType.VarChar, 50).Value = vert;
cmd.Parameters.Add("@subverti", SqlDbType.VarChar, 50).Value = sverti;
cmd.Parameters.Add("@offerdate", SqlDbType.DateTime).Value = DateTime.Parse(txtofferdate.Text);
cmd.Parameters.Add("@name", SqlDbType.VarChar, 50).Value = name;
cmd.Parameters.Add("@addr1", SqlDbType.VarChar, 50).Value = txtaddr1.Text;
cmd.Parameters.Add("@addr2", SqlDbType.VarChar, 50).Value = txtaddr2.Text;
cmd.Parameters.Add("@addr3", SqlDbType.VarChar, 50).Value = txtaddr3.Text;
cmd.Parameters.Add("@pin", SqlDbType.VarChar, 50).Value = txtpin.Text;
cmd.Parameters.Add("@mob", SqlDbType.VarChar, 50).Value = txtmob.Text;
cmd.Parameters.Add("@email", SqlDbType.VarChar, 50).Value = txtemail.Text;
cmd.Parameters.Add("@desig", SqlDbType.VarChar, 50).Value = desig;
cmd.Parameters.Add("@grade", SqlDbType.VarChar, 50).Value = grade;
cmd.Parameters.Add("@loc", SqlDbType.VarChar, 50).Value = loc;
cmd.Parameters.Add("@ctc", SqlDbType.VarChar, 50).Value = txtctc.Text;
cmd.Parameters.Add("@joindate", SqlDbType.DateTime).Value = DateTime.Parse(txtdoj.Text);
cmd.Parameters.Add("@reporting", SqlDbType.VarChar, 50).Value = reporting;

and many more. 

after submiting all values is going to show in multiple tables.

can i use viewmodel to create ?


Answers (4)