By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,902 Members | 1,268 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,902 IT Pros & Developers. It's quick & easy.

how to pass dataset more rows in asp.net

ramanan ram
P: 26
i am using .net(c#) with oracle. now,the Dataset contains five rows.using for loop that dataset value to pass the procedure argument and insert into specific table.if i am execute cannot inserted into the table .but without for loop single row inserted successfully.how to pass dataset more values to procedure argument.
here that coding:
Expand|Select|Wrap|Line Numbers
  1.  for(i=0; i < objDataset.Rows.Count; i++)
  2.                 {
  3.  if (objDataset.Tables[0].Rows[i].IsNull(0))
  4.                     {
  5.                         objDataset.Tables[0].Rows[i].Delete();
  6.  
  7.                     }
  8.                 }  objDataset.Tables[0].AcceptChanges();
  9.                 DataTable dt = new DataTable();
  10.                 dt = objDataset.Tables[0];
  11.                 if (dt.Rows.Count > 0)
  12.                 {
  13.                     for (i = 0; i < dt.Rows.Count; i++)
  14.                     {
  15.                         //  dbs.AddInParameter(dbcommand, "PQUOTEID", DbType.String,  dt.Rows[i]["Division"].ToString().Trim());
  16.                         dbcomm.Parameters.Add("pvdivision", OleDbType.VarChar, 200).Value = dt.Rows[i]["Division"].ToString().Trim();
  17.                         dbcomm.Parameters.Add("pvcountry", OleDbType.VarChar, 200).Value = dt.Rows[i]["Country"].ToString().Trim();
  18.                         dbcomm.Parameters.Add("pvlanded", OleDbType.VarChar, 200).Value = dt.Rows[i]["Landed"].ToString().Trim();
  19.                         dbcomm.Parameters.Add("pvtype", OleDbType.VarChar, 200).Value = dt.Rows[i]["Type"].ToString().Trim();
  20.                         dbcomm.Parameters.Add("pvcust", OleDbType.VarChar, 200).Value = dt.Rows[i]["Cust"].ToString().Trim();
  21.  
  22.                     }
  23.                 }
  24.  
  25.                 dbcomm.ExecuteNonQuery();
please help..
May 11 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.