4
Answers

How to insert multiple rows from form in to database.

sita k

sita k

10y
2.4k
1
Hello Everyone, I am trying to insert multiple rows in to database but not sure how to proceed. In the form I am selecting company name and then I need to enter employee records one by one. How to enter the multiple records at a time? Below is my piece of code which works fine for single record when submitting: OracleCommand cmd1 = new OracleCommand("Insert_Employee_Det", con); cmd1.CommandType = CommandType.StoredProcedure; cmd1.Parameters.Add(new OracleParameter("fname", txtfname1.Text)); cmd1.Parameters.Add(new OracleParameter("lname", txtlname1.Text)); cmd1.Parameters.Add(new OracleParameter("address", txtaddr.Text)); try { con.Open(); cmd1.ExecuteNonQuery(); } catch (Exception err) { } finally { con.Close(); } Regards.
Answers (4)