473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

data Adapter

I use my functions to create adapter and fill dataSet:

funkcije.createAdapter("c_CPOSkupaj", False, myParams).Fill(ds,
"brezReklam")

If I use this function another time to fill dataSet with other table, I get
an error message, like that the parameter already exists.
The SqlParameter with ParameterName '@datumZ' is already contained by
another SqlParameterCollection

So, I would like to clear parameters:

adapter.SelectCommand.Parameters.Clear()

How can I do that?

I don't have reference to data adapter, because it's created by function.

Does exists something like:

currentActiveAdapter.SelectCommand.Parameters.Clea r ?

Thank you,
Simon
Nov 21 '05 #1
2 5190
Something like this ? .. ?

da.InsertCommand.Parameters.Clear

Terry Burns

http://TrainingOn.net

"simon" <si*********@stud-moderna.si> wrote in message
news:e$*************@TK2MSFTNGP09.phx.gbl...
I use my functions to create adapter and fill dataSet:

funkcije.createAdapter("c_CPOSkupaj", False, myParams).Fill(ds,
"brezReklam")

If I use this function another time to fill dataSet with other table, I
get an error message, like that the parameter already exists.
The SqlParameter with ParameterName '@datumZ' is already contained by
another SqlParameterCollection

So, I would like to clear parameters:

adapter.SelectCommand.Parameters.Clear()

How can I do that?

I don't have reference to data adapter, because it's created by function.

Does exists something like:

currentActiveAdapter.SelectCommand.Parameters.Clea r ?

Thank you,
Simon

Nov 21 '05 #2
Hi,

I know that I can use da.InsertCommand.Parameters.Clear.

But I use function for insert table into data set because I don't want to reference and create each time data adapter.

Instead of this:

Dim da As SqlDataAdapter
da = createAdapter(sqlStr, False, myParams)
da.Fill(myDataSet, tableName)
da.SelectCommand.Parameters.Clear()
da.Dispose()
da = Nothing

I do everything in one line:

funkcije.createAdapter(sqlStr, False, myParams).Fill(ds,"tableName")

Function createAdapter returns adapter, but after creating adapter and use fill method I can't clear the parameters because I don't have reference to it.

I need something like: currentActiveAdapter.SelectCommand.Parameters.Clea r()

I hope you know what I mean.

Thank you,
Simon


"OHM ( Terry Burns )" <me@mine.com> wrote in message news:%2****************@TK2MSFTNGP14.phx.gbl...
Something like this ? .. ?

da.InsertCommand.Parameters.Clear

Terry Burns

http://TrainingOn.net





"simon" <si*********@stud-moderna.si> wrote in message
news:e$*************@TK2MSFTNGP09.phx.gbl...
I use my functions to create adapter and fill dataSet:

funkcije.createAdapter("c_CPOSkupaj", False, myParams).Fill(ds,
"brezReklam")

If I use this function another time to fill dataSet with other table, I
get an error message, like that the parameter already exists.
The SqlParameter with ParameterName '@datumZ' is already contained by
another SqlParameterCollection

So, I would like to clear parameters:

adapter.SelectCommand.Parameters.Clear()

How can I do that?

I don't have reference to data adapter, because it's created by function.

Does exists something like:

currentActiveAdapter.SelectCommand.Parameters.Clea r ?

Thank you,
Simon


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: pmud | last post by:
Hi, I need to display columns in a data grid based on 7 different queries. Now I have 32 questions: 1. Is it possble to have 1 single data adapter with 7 queries & 1 data set or do I need to...
5
by: Rick | last post by:
The data adapter wizard allows you to add more than one table, but that doesn't seem to work right when setting up a dataset. Some of the documentation I have read states that only one table...
4
by: William | last post by:
After much frustration I was able to update my data store via code only. Using the data adapter was the only way I was able to set up all the objects written in my code. Basically, I cheated by...
9
by: Brad | last post by:
I have written some code to manipulate data/records in a MASTER (order header) and DETAIL (order details) tables. What I have written is too extensive to post but essentially trying to: 1....
7
by: GatorBait | last post by:
Hi all, I am having a problem with my data adapter update command. I have generated the data adapter in the IDE and then I built a dataset. The dataset can get changed in the program and I...
12
by: Randy | last post by:
Hi, Trying to pass along a table row delete to the datasource, but I'm crashing. Here is the code: Private Sub btnDeleteIngr_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles...
6
by: Suresh | last post by:
Hi All, I am fetching a dataset from the database under some condition. After this I create a data table. Traverse in the original dataset & add each row to created data table as it is through...
9
by: SAL | last post by:
Hello, I have a Dataset that I have table adapters in I designed using the designer (DataLayer). I have a business logic layer that immulates the DataLayer which may/may not have additional logic...
6
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1)...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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....
0
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.