473,406 Members | 2,281 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,406 software developers and data experts.

data adaptor not available

Since upgrading from .NET 2003 to .NET 2005, I've had a few problems
adjusting. One, I seem unable to get around is not having the
DataAdaptor available to me from the tool box. It appears I only have
DataSets and TableAdaptors available to me. In the code behind section,
I'm unable to update my information to the database simply because I
don't have the DataAdaptor.update available to me. I attempted
TableAdaptor.update() but can't seem to get the right parameters to
satisfy it. Has anyone used a method that works to update or add new
records using DataSets and TableAdaptors?

Nov 27 '05 #1
1 1314
Hi,

<bi*********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
Since upgrading from .NET 2003 to .NET 2005, I've had a few problems
adjusting. One, I seem unable to get around is not having the
DataAdaptor available to me from the tool box. It appears I only have
DataSets and TableAdaptors available to me. In the code behind section,
I'm unable to update my information to the database simply because I
don't have the DataAdaptor.update available to me. I attempted
TableAdaptor.update() but can't seem to get the right parameters to
satisfy it. Has anyone used a method that works to update or add new
records using DataSets and TableAdaptors?


Yes.

First create a DataSource.
- Menu->Data->Show Data Sources->Add New DataSource
- Follow wizard
- You should end with one Typed-DataSet with one or more DataTable('s) and a
TableAdapter for each DataTable.

The Typed-DataSet is shown as a Data Source inside Data Sources window.
You can simple drag a DataTable onto a Form and everything will be setup on
the Form ( DataGridView, BindingNavigator, BindingSource, TableAdapter,
DataSet). In the code view you should already see all steps required to
Fill and Update using a TableAdapter.

But you can offcourse do it entirely from code:
' Suppose you have a typed DataSet with one
' DataTable named Customers:

Dim ds As New NorthwindDataSet
Dim ta As New CustomersTableAdapter

ta.Fill( ds.Customers )
ds.Customers.AddCustomersRow( "Name0", ".... " )
ds.Customers.AddCustomersRow( "Name2", ".... " )
ds.Customers.AddCustomersRow( "Name3", ".... " )
ds.Customers(0).Name = "Name1"
ta.Update( ds.Customers )

An advantage of TableAdapter's is that they can have more then one select
query unlike DataAdapters. When you select a DataSet inside Data Sources
window and click the "show in DataSet designer" button, you can visually see
and configure all DataTable's and TableAdapter's.

TableAdapter's can also support direct update, eg:
CustomerTableAdapter.Insert( "Name4", "..." )

For more information, read:
http://www.msdn.microsoft.com/vbasic...wdtastvs05.asp

Note that you can still use the old DataAdapter/Connection objects from the
Designer, just right click the toolbox and select "Choose Items".

HTH,
Greetings


Nov 27 '05 #2

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

Similar topics

3
by: Stanislaw Salik | last post by:
Hi, Lets suppose we want to use generic algotithms on collections of pointers (both raw and smart). For example, we want to sort a vector of (smart)pointers. We need a comparator that will take...
2
by: Matthias | last post by:
Hi, again, I have a problem using containers of pointers (I'm near to the point to drop them alltogether and work on usual containers instead...). The problem is, if I want to perform some...
3
by: Matthias Kaeppler | last post by:
Hello, I need to sort a range of pointers with a predicate which applies to the pointees. I tried to use boost::indirect_iterator, however, this will sort the container with the pointees instead...
1
by: Tony Johansson | last post by:
Hello! I'm reading about design pattern adaptor in the GOF book and there is something that sounds strange. When you use the adaptor design pattern you have these participants. *Target -...
0
by: Tony Johansson | last post by:
Hello!! This is about the adaptor design pattern. If you use the class adaptor its easy to override. It says an object adaptor makes it harder to override Adaptee behavior. It will require...
1
by: | last post by:
Greetings All, I'm trying to access a excel file using the odbc data adaptor but the tables arent showing up. I can get connected to the excel file using the Wizard but when I go to do the odbc...
5
by: Pankaj | last post by:
Hi i am inserting the data into database throught variables. On click event of button m using this code: Dim objCon As New OleDbConnection(CONNECTION) Dim objCmd As New OleDbCommand(SQL,...
3
by: PengYu.UT | last post by:
Suppose I want a ring_iterator, which is almost like the vector::iterator. But it will equals begin(), when it passed the end(). It is easy to write an adaptor for it. But I'm wondering if there is...
3
by: iKiLL | last post by:
Hi all The Code is below but i will give you a brief over view first. I am using C#, SQL Mobile and the CF2.0 with Merge Replication. My Primary Keys are all "uniqueidentifier" types...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.