473,569 Members | 2,791 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataAdapter.upd ate() and a DataSet in session

Hi.

We want to use a DataAdapter's update method to store changes to a dataset
back to the database. What's the best approach, if that dataset is being
stored in session and passed around the site, effectively disconnecting it
from its original adapter. By the time we get to use the update method, the
original DataAdapter is long gone.

Thanks,
Galen
Nov 17 '05 #1
1 1407
You will need to recreate an adapter, reflecting the one that was used to
fill the dataset since the dataset carries no information with it about the
underlying data source.

--
Patrik Löwendahl
cshrp.net - " Elegant code by witty programmers "
cornerstone.se - " IT Training for professionals "
"Galen Harris" <ga************ ****@ceridianNO SPAM.com> wrote in message
news:Oi******** ******@TK2MSFTN GP10.phx.gbl...
Hi.

We want to use a DataAdapter's update method to store changes to a dataset
back to the database. What's the best approach, if that dataset is being
stored in session and passed around the site, effectively disconnecting it
from its original adapter. By the time we get to use the update method, the original DataAdapter is long gone.

Thanks,
Galen

Nov 17 '05 #2

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

Similar topics

2
4222
by: hch | last post by:
dataAdapter.Update(data, "TableName") won’t work! I was about to deploy my first website on the Internet only to discover that the dataAdapter.Update() throws the Server Error in the third underline. It was working fine before. ConnectionString in Web.config: ----------------------------------------- <?xml version="1.0"...
1
1354
by: Galen Harris | last post by:
What's the best practice to use the dataadapter.update on a dataset that's been stored in session? We create a dataset on one page, and later in site, we want to call the dataadapter.update() to save the changes. Problem is, the original adapter is long gone. It seems like cloogy to recreate the exact adapter again, fill another dataset,...
20
1789
by: Janaka | last post by:
I tend to use the SqlDataAdapter class in WinForms projects because once the inital data is loaded any modifications can be easily added/updated through a call to the Update() method. I've found in aspnet that the same thing is possible but because of the stateless nature of the web in order to do this I have to go through the following...
6
1572
by: Geoff Pennington | last post by:
I have a class method that returns a DataAdapter. I want to access the table(s) contained in the DataAdapter. Of course, accessing the DataSets would be good enough, because I could get the tables from there. I can't find a way to do this. Am I missing something? Much obliged.
13
2075
by: Doug Bell | last post by:
Hi, I thought I had this sorted this morning but it is still a problem. My application has a DataAccess Class. When it starts, it: Connects to a DB (OLE DB) If it connects it uses an OleDbCommand with an SQL String and the connection it has a DataAdapter with the command then it fills the DataSet's DataTable with the streamed data.
8
2680
by: Zorpiedoman | last post by:
I keep getting a concurrency exception the second time I make a change and attempt to update a dataadapter. It appears this is by design, so there must be something I can do to avoid it. Example: I have a dataadapter that contains one table with one row. I change the value of the 'FisrtName' column in that row from Jack to John. I call...
2
13944
by: susan.f.barrett | last post by:
Hi, Despite me being able to type the following in to SQL Server and it updating 1 row: > updatestockcategory 1093, 839 In my code, it is not updating any rows. dataSet = new DataSet();
6
13981
by: Rich | last post by:
Dim da As New SqlDataAdapter("Select * from tbl1", conn) dim tblx As New DataTable da.Fill(tblx) '--works OK up to this point da.UpdateCommand = New SqlCommand da.UpdateCommand.Connection = conn da.UpdateCommand.CommandText = "Update tbl1 set fld1 = 'test' where ID = 1" da.Update(tblx) '--tblx/tbl1 not getting updated here.
3
2342
by: Fred Chateau | last post by:
Any obvious reason here why data is not being loaded into the database? SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlCommand); SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter); dataAdapter.Fill(dataSet, "POI_Entity"); DataRow dataRow = dataSet.Tables.NewRow(); dataRow = 1; dataRow =...
0
7605
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...
0
7917
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. ...
0
8118
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...
1
5501
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...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
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...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.