473,657 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update DataSet with StoredProcedure

When I have a stored procedure, with multiple tables in MS Access, in a
dataset and I change it in my DataGrid, I get the next message when I want to
update my DataSet:

InvalidOperatio nException:
"Dynamic SQL generation is not supported against a SelectCommand that does
not return any base table information."

I tried to use an update query but when I fill my DataTable using
myDataAdapter.F ill(myDataSet, myTable)
directly after de update query the data is not yet persistent bij MS Access.
And therefore I get the old data back into my DataSet.

Is there any way to update a DataSet with multiple tables or make the data
persistent after the update query.
Just to make sure the data is corrct after I fill my DataAdapter?

Thanx.

Nov 21 '05 #1
1 1562
I'm guessing you are using a CommandBuilder? If so - you can't use Update
with a joined table.

Basically, if you have multiple tables, the most straightforward way to
handle it is query each table individually and load each table in a dataset.
Add datarelations between them. Edit away. Then call Update on each table
with a separate update command.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Foef" <Fo**@discussio ns.microsoft.co m> wrote in message
news:B3******** *************** ***********@mic rosoft.com...
When I have a stored procedure, with multiple tables in MS Access, in a
dataset and I change it in my DataGrid, I get the next message when I want to update my DataSet:

InvalidOperatio nException:
"Dynamic SQL generation is not supported against a SelectCommand that does
not return any base table information."

I tried to use an update query but when I fill my DataTable using
myDataAdapter.F ill(myDataSet, myTable)
directly after de update query the data is not yet persistent bij MS Access. And therefore I get the old data back into my DataSet.

Is there any way to update a DataSet with multiple tables or make the data
persistent after the update query.
Just to make sure the data is corrct after I fill my DataAdapter?

Thanx.

Nov 21 '05 #2

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

Similar topics

1
2239
by: Yog | last post by:
I have a datagrid binded to a dataset and once the user updates the grid my dataset is reflected. When i wanted to save the data to tables, however i needed to insert this data into another table instead of the same table. I am getting the error in the line oDa.Update(oDs.Tables.Select("", "", DataViewRowState.CurrentRows)); "Update requires a valid UpdateCommand when passed DataRow collection with
1
3084
by: Pesko S | last post by:
Hi, Could anybody just point me in a direction where I can find information on how the heck I can update a database with relational data from an XML file. I use stored procedures to insert the data. And I am NOT storing the xml in the database. I want to map the xml elements to the database columns. I am about to start peeling my skin off in frustration about this. There
3
9751
by: Justin | last post by:
I have created a dataset with two tables and an insert command, I need to be able to retreive the Key Identity after inserting into table "A" for use in table "B". Should I use ExecuteScalar() or is there a better solution? Thanks, Justin.
9
5268
by: joun | last post by:
Hi all, i'm using this code to insert records into an Access table from asp.net, using a stored procedure, called qry_InsertData: PARAMETERS Long, Long, Text(20), Long, DateTime; INSERT INTO Table ( ID, Cod, CodArt, Q1, DataUscita ) VALUES (pID, pCod, pCod, pQ1, pDataUscita);
5
1864
by: Hennie | last post by:
When trying to update a record in an editable datagrid I ran into a few problems. My update procedure is just not working. Can someone please have a look at my code and see what am I doing wrong. I had to set the datagrid's DataKeyField to MailSubscriberID manually since vs does not do it automatically. Thanks
4
2267
by: steroche | last post by:
I would REALLY appreciate help please please please! Im sure it is probably blindingly obvious to most of you but I am totally in the dark here!I am lost - i thought i had finally figured out this dataSet updating lark when i realised that i think i am right back at square 1!!! Here's my scenario - i have a SQLDB and i retrieve all my data from that into a dataset and display this to a datagrid(WebForm). I have got this grid sorted and...
4
1256
by: simon | last post by:
I have cashed dataSet ds = Cache("userDataSet") If ds Is Nothing Then Cache("userDataSet") = createDataSet() End If function CreateDataSet 'code for creating dataSet 'SELECT name,surname FROM testUpdate WHERE id=1
0
1177
by: BVA3105 | last post by:
i update a database with a dataset and a SqlAdapter with success but when i clear and refill my dataset i always retreive the old values. I have to wait for 5 seconds to get the corrects values. ' Step one ==update directly the dataset in memory Dataset.table.item(0)._Date = DateValue Dataset.table.item(0).Time = TimeValue Dataset.table.item(0).Tarif = TarifValue ' Step two ==create and exexute a command to update database
2
8048
by: chandu | last post by:
Hi Guys, i am beginer in the worls of Asp.net and C#.net I have one problem that I have stored my changes of data into dataset using disconnected dataset and after completion of all changes i want to update that change to the database using stored procedure. But i am not getting How to do it,
0
8413
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
8324
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,...
0
8842
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
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
8617
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4173
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...
1
2742
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
1970
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.