DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Sat, 14 Jul 2007 15:24:14 -0600,    posted on: microsoft.public.dotnet.framework.adonet        back       

Thread Index
  1    Ronald S. Cook
          2    Ronald S. Cook


How save DataSet back to database?   
In my client Windows application, I am receiving a DataSet containing one 
DataTable.  This comes to my client via the business tier on a different 
physical machine (we're using WCF if that matters).

After I make changes to the data in the underlying DataTable, I send the 
DataSet back to the business tier.  In the business tier, what should my 
code look like to persist the data up to the database?

I'm assuming I need to do something like this:

Dim Connection As New SqlConnection()
Connection.ConnectionString = My.Settings.COWFeedyardConnectionString
Dim Command As New SqlCommand()
Command.Connection = Connection
Dim DataAdapter As New SqlDataAdapter()
DataAdapter.UpdateCommand = Command
DataAdapter.Update(PenDataSet)

... but I get the errror: "Update unable to find TableMapping['Table'] or 
DataTable 'Table'."

Thanks for any help,
Ron
Date:Sat, 14 Jul 2007 15:24:14 -0600   Author:  

Re: How save DataSet back to database?   
And actually, I just changed the update line to instead read:

DataAdapter.Update(PenDataSet, "Results")
The code now does not break on error, it seems to execute the line but no 
changes were actually ssaved to the database.

Thanks,
Ron




"Ronald S. Cook"  wrote in message 
news:ew48a1lxHHA.3956@TK2MSFTNGP06.phx.gbl...

> In my client Windows application, I am receiving a DataSet containing one 
> DataTable.  This comes to my client via the business tier on a different 
> physical machine (we're using WCF if that matters).
>
> After I make changes to the data in the underlying DataTable, I send the 
> DataSet back to the business tier.  In the business tier, what should my 
> code look like to persist the data up to the database?
>
> I'm assuming I need to do something like this:
>
> Dim Connection As New SqlConnection()
> Connection.ConnectionString = My.Settings.COWFeedyardConnectionString
> Dim Command As New SqlCommand()
> Command.Connection = Connection
> Dim DataAdapter As New SqlDataAdapter()
> DataAdapter.UpdateCommand = Command
> DataAdapter.Update(PenDataSet)
>
> .. but I get the errror: "Update unable to find TableMapping['Table'] or 
> DataTable 'Table'."
>
> Thanks for any help,
> Ron
>
> 
Date:Sat, 14 Jul 2007 15:32:47 -0600   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us