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.ho w to pass dataset more values to procedure argument.
here that coding:
please help..
here that coding:
Code:
for(i=0; i < objDataset.Rows.Count; i++)
{
if (objDataset.Tables[0].Rows[i].IsNull(0))
{
objDataset.Tables[0].Rows[i].Delete();
}
} objDataset.Tables[0].AcceptChanges();
DataTable dt = new DataTable();
dt = objDataset.Tables[0];
if (dt.Rows.Count > 0)
{
for (i = 0; i < dt.Rows.Count; i++)
{
// dbs.AddInParameter(dbcommand, "PQUOTEID", DbType.String, dt.Rows[i]["Division"].ToString().Trim());
dbcomm.Parameters.Add("pvdivision", OleDbType.VarChar, 200).Value = dt.Rows[i]["Division"].ToString().Trim();
dbcomm.Parameters.Add("pvcountry", OleDbType.VarChar, 200).Value = dt.Rows[i]["Country"].ToString().Trim();
dbcomm.Parameters.Add("pvlanded", OleDbType.VarChar, 200).Value = dt.Rows[i]["Landed"].ToString().Trim();
dbcomm.Parameters.Add("pvtype", OleDbType.VarChar, 200).Value = dt.Rows[i]["Type"].ToString().Trim();
dbcomm.Parameters.Add("pvcust", OleDbType.VarChar, 200).Value = dt.Rows[i]["Cust"].ToString().Trim();
}
}
dbcomm.ExecuteNonQuery();