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: - 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();
please help..
You need to execute within your loop. And don't forget to clear your parameters each time.
4 2819
You need to execute within your loop. And don't forget to clear your parameters each time.
dbcomm.parametrs.clear(); within in for loop
add this line.
if dataadapter object is da
then to add parameters
da.selectcommand.parameters.add();
- 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();
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mike P |
last post by:
Is it possible to return a dataset from a stored procedure, or would you
need to write the SQL in your .cs file to return the dataset?
Any assistance would be really appreciated.
Cheers,
...
|
by: PawelR |
last post by:
Hello everybody,
I have one littel question:
How fill DataSet values witch return stored procedure?
My SP have parameters.
Thanks
PawelR
|
by: TJS |
last post by:
Is there a way to do this ??
|
by: Nikolay Petrov |
last post by:
How to fill DataSet from stored procedure?
|
by: abc my vclass |
last post by:
How to generate a dataset from stored procedure which have many resultsets?
I try Dataset designer from VS2005, it only generate first table from stored
procedure on server explorer. Another...
|
by: Patricio |
last post by:
Hello all
I have a form that contains several textbox.
I have also a DataSet that contains the Fill function by ID.
How can I assign the DataSet values into my TextBox?
Thanks a lot.
|
by: vickilynnpgc |
last post by:
I have a tsql stored procedure I want to drag from server explorer onto an
xsd file. I get the error ' xml schema could not be interpreted'. The stored
procedure does a select from a udf, that's...
|
by: SteveT |
last post by:
I am wanting to populate several treeviews, one for the <TRs>
group and one for the <TGsgroup. Is there a simplier way
to populate the Treeview than the one I did below? It seems
difficult to...
|
by: Jon B |
last post by:
Hi There!
I'm looking into Strongly Typed DataSets in the .NET Framework. I know it
can generated strongly typed tables as objects and column names as
properties.
However, one thing that I...
|
by: jobs |
last post by:
How do you return dataset from a vb.net function?
my sp:
ALTER FUNCTION .
(
)
RETURNS TABLE
AS
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |