473,806 Members | 2,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

data Adapter

I use my functions to create adapter and fill dataSet:

funkcije.create Adapter("c_CPOS kupaj", 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 SqlParameterCol lection

So, I would like to clear parameters:

adapter.SelectC ommand.Paramete rs.Clear()

How can I do that?

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

Does exists something like:

currentActiveAd apter.SelectCom mand.Parameters .Clear ?

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

da.InsertComman d.Parameters.Cl ear

Terry Burns

http://TrainingOn.net

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

funkcije.create Adapter("c_CPOS kupaj", 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 SqlParameterCol lection

So, I would like to clear parameters:

adapter.SelectC ommand.Paramete rs.Clear()

How can I do that?

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

Does exists something like:

currentActiveAd apter.SelectCom mand.Parameters .Clear ?

Thank you,
Simon

Nov 21 '05 #2
Hi,

I know that I can use da.InsertComman d.Parameters.Cl ear.

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(s qlStr, False, myParams)
da.Fill(myDataS et, tableName)
da.SelectComman d.Parameters.Cl ear()
da.Dispose()
da = Nothing

I do everything in one line:

funkcije.create Adapter(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: currentActiveAd apter.SelectCom mand.Parameters .Clear()

I hope you know what I mean.

Thank you,
Simon


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

da.InsertComman d.Parameters.Cl ear

Terry Burns

http://TrainingOn.net





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

funkcije.create Adapter("c_CPOS kupaj", 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 SqlParameterCol lection

So, I would like to clear parameters:

adapter.SelectC ommand.Paramete rs.Clear()

How can I do that?

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

Does exists something like:

currentActiveAd apter.SelectCom mand.Parameters .Clear ?

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
2519
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 have a separate data adapter & a separate data set for each select query? If thats possible then how?
5
2463
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 should be selected per data adapter, and then you use a DataRelation object to pull join them together. Okay, if that's the case then fine, but why would the data adapter allow you to add more than one table if this is not how it is supposed to work....
4
1835
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 creating an adapter and then copy, paste, modify it's code to suite my needs. This was the end result: Private sub updateTable( ) Dim myData As DataSet 'Command is a form level oledbcommand object Dim Adapter1 As New OleDbDataAdapter(Command)
9
2068
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. Assign to a datarow (dr1) the first record of the MASTER table 2. Assign to another datarow (dr2) the second record of the MASTER table 3. If dr1.field1 = dr2.field1, then proceed, otherwise do stop 4. Assign to a third datarow (dr3) the first record...
7
3976
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 would like to update the database. I tried to do so using the update method of the data adapter, but the table is not getting updated. While debugging I made sure that the dataset has the correct value prior to calling the update method. I think...
12
20011
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 btnDeleteIngr.Click Dim vbResponse As Integer vbResponse = MessageBox.Show("Are you sure that you want to delete " + tbIngr.Text + "?", "Confirm Delete", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning)
6
3801
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 LoadDataRow method. After adding the row I just update 4-5 columns out of 20 columns in the row. After entire looping I fire the AcceptChanges method on data table. After this I am trying to update this data back to database in two ways - 1) Merge...
9
2746
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 in. My business classes are, of course, decorated with the: <System.ComponentModel.DataObject() attribute. So, I drop a GridView on a webform and set its datasource to an ObjectDatasource which in turn is using one of my business logic...
6
2948
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) Constraint pk_table1 Primary Key,
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10373
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9192
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5683
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3852
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.