473,549 Members | 2,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Posting a dataset to a database

vaj
Hey,
Im creating a system on a pocket pc based on win ce 4.2 and i need to
tranfer three datasets to a remote server on the network.Could anyone
tell me the easiest way to do this?
cheers,
-vaj

Jun 28 '06 #1
5 1105
vaj wrote:
Hey,
Im creating a system on a pocket pc based on win ce 4.2 and i need to
tranfer three datasets to a remote server on the network.Could anyone
tell me the easiest way to do this?
cheers,
-vaj


Here's a solution that I'm trying to get working on one of my own
projects. It pretty much works, although I don't know if it's a best
practice or anything...(May be some others can weigh in on the overall
approach.)

I'm not sure what the .NET framework looks like on WinCE, but in the
full .NET framework, you can get a dataset containing just
updated/changed data with something like:

dsModified = dsModified.GetC hanges()

See the docs on .GetChanges for a fuller explanation of some options
there.

Then you take that dataset and pass it to a web service, which has a
web method that accepts a dataset as a parameter, and merges it with a
dataset containing the latest data from the server (da = data adapter,
ds = dataset):

sql = "SELECT NameFirst, NameLast FROM tblContacts"
cn = DBConnect()
cn.Open()
daOriginal = New SqlDataAdapter( sql, cn)
daOriginal.Fill (dsOriginal)
dsOriginal.Merg e(dsModified)

Then you write the data to the database:

daOriginal.Upda teCommand = cmd.GetUpdateCo mmand()
daOriginal.Upda te(dsOriginal)

We've had to do some other things like explicitly setting the primary
key on dsModified to match the pkey on dsOriginal, but that might be
due to some conversions to and from XML and old-style ADO recordsets we
do between the various layers of the app.

If nothing merges in, it may be because the rowstate of the dateset
rows have been set back to "unchanged" as it came into the web service.
In ADO.NET 2.0, you can apparently manually set the rowstate of the
rows.

The MSDN on .Merge is pretty helpful, although it doesn't seem to
recommend using Merge for this purpose.

Jun 28 '06 #2
Vaj,

If it are alone inserts of new rows and the schemas are complete equal (the
pocket pc dataset may miss columns exept the primary key), than it is
relative simple.

If it are also updates than it will be much more work, if the original
dataset is not retrieved from that database.

Therefore what is it?

Cor
"vaj" <va*@spaceair.c o.uk> schreef in bericht
news:11******** **************@ y41g2000cwy.goo glegroups.com.. .
Hey,
Im creating a system on a pocket pc based on win ce 4.2 and i need to
tranfer three datasets to a remote server on the network.Could anyone
tell me the easiest way to do this?
cheers,
-vaj

Jun 28 '06 #3
vaj
thanks guys but i dont think i explained the problem correctly,sorry !
the thing im not looking to tranfer the datasets on to the database in
the device but to a remote server.
tried RDA but my sql server isnt compatible with the version of the
server i have on the device.So what me and my colligues thought was to
do a http posting to the serevr.but the problem is non of us know how
to do this.
could any of u tell me how to do this or is there anyother way i can
get this data transferred?
ad*****@yahoo.c om wrote:
vaj wrote:
Hey,
Im creating a system on a pocket pc based on win ce 4.2 and i need to
tranfer three datasets to a remote server on the network.Could anyone
tell me the easiest way to do this?
cheers,
-vaj


Here's a solution that I'm trying to get working on one of my own
projects. It pretty much works, although I don't know if it's a best
practice or anything...(May be some others can weigh in on the overall
approach.)

I'm not sure what the .NET framework looks like on WinCE, but in the
full .NET framework, you can get a dataset containing just
updated/changed data with something like:

dsModified = dsModified.GetC hanges()

See the docs on .GetChanges for a fuller explanation of some options
there.

Then you take that dataset and pass it to a web service, which has a
web method that accepts a dataset as a parameter, and merges it with a
dataset containing the latest data from the server (da = data adapter,
ds = dataset):

sql = "SELECT NameFirst, NameLast FROM tblContacts"
cn = DBConnect()
cn.Open()
daOriginal = New SqlDataAdapter( sql, cn)
daOriginal.Fill (dsOriginal)
dsOriginal.Merg e(dsModified)

Then you write the data to the database:

daOriginal.Upda teCommand = cmd.GetUpdateCo mmand()
daOriginal.Upda te(dsOriginal)

We've had to do some other things like explicitly setting the primary
key on dsModified to match the pkey on dsOriginal, but that might be
due to some conversions to and from XML and old-style ADO recordsets we
do between the various layers of the app.

If nothing merges in, it may be because the rowstate of the dateset
rows have been set back to "unchanged" as it came into the web service.
In ADO.NET 2.0, you can apparently manually set the rowstate of the
rows.

The MSDN on .Merge is pretty helpful, although it doesn't seem to
recommend using Merge for this purpose.


Jun 29 '06 #4
vaj, we understand the issue. what we are suggesting is setting up a
..NET web service on the server, creating a web method to process the
incoming dataset from your pocket pc, and then passing the dataset from
the pocket pc to the web service. you should read up on web services to
see how they work:

http://www.codeproject.com/dotnet/intro2websvc.asp

basically, the pocket pc will be the client or consumer of the web
service. on the app you are writing for the pocket pc, you include a
"web reference" to the web service server. then, on the pocket pc, you
call a method from the web service on the server, like:

MyWebService.Up dateData(dsUpda tedDataset)

This will send your dataset over to the web service, which can process
the modifications and write them to the database.

please post back to this thread with more questions instead of creating
another new thread on the newsgroup. you have triple-posted this
question already.

vaj wrote:
thanks guys but i dont think i explained the problem correctly,sorry !
the thing im not looking to tranfer the datasets on to the database in
the device but to a remote server.
tried RDA but my sql server isnt compatible with the version of the
server i have on the device.So what me and my colligues thought was to
do a http posting to the serevr.but the problem is non of us know how
to do this.
could any of u tell me how to do this or is there anyother way i can
get this data transferred?
ad*****@yahoo.c om wrote:
vaj wrote:
Hey,
Im creating a system on a pocket pc based on win ce 4.2 and i need to
tranfer three datasets to a remote server on the network.Could anyone
tell me the easiest way to do this?
cheers,
-vaj


Here's a solution that I'm trying to get working on one of my own
projects. It pretty much works, although I don't know if it's a best
practice or anything...(May be some others can weigh in on the overall
approach.)

I'm not sure what the .NET framework looks like on WinCE, but in the
full .NET framework, you can get a dataset containing just
updated/changed data with something like:

dsModified = dsModified.GetC hanges()

See the docs on .GetChanges for a fuller explanation of some options
there.

Then you take that dataset and pass it to a web service, which has a
web method that accepts a dataset as a parameter, and merges it with a
dataset containing the latest data from the server (da = data adapter,
ds = dataset):

sql = "SELECT NameFirst, NameLast FROM tblContacts"
cn = DBConnect()
cn.Open()
daOriginal = New SqlDataAdapter( sql, cn)
daOriginal.Fill (dsOriginal)
dsOriginal.Merg e(dsModified)

Then you write the data to the database:

daOriginal.Upda teCommand = cmd.GetUpdateCo mmand()
daOriginal.Upda te(dsOriginal)

We've had to do some other things like explicitly setting the primary
key on dsModified to match the pkey on dsOriginal, but that might be
due to some conversions to and from XML and old-style ADO recordsets we
do between the various layers of the app.

If nothing merges in, it may be because the rowstate of the dateset
rows have been set back to "unchanged" as it came into the web service.
In ADO.NET 2.0, you can apparently manually set the rowstate of the
rows.

The MSDN on .Merge is pretty helpful, although it doesn't seem to
recommend using Merge for this purpose.


Jun 29 '06 #5
vaj
ok think i get it.,thanks guys
ad*****@yahoo.c om wrote:
vaj, we understand the issue. what we are suggesting is setting up a
.NET web service on the server, creating a web method to process the
incoming dataset from your pocket pc, and then passing the dataset from
the pocket pc to the web service. you should read up on web services to
see how they work:

http://www.codeproject.com/dotnet/intro2websvc.asp

basically, the pocket pc will be the client or consumer of the web
service. on the app you are writing for the pocket pc, you include a
"web reference" to the web service server. then, on the pocket pc, you
call a method from the web service on the server, like:

MyWebService.Up dateData(dsUpda tedDataset)

This will send your dataset over to the web service, which can process
the modifications and write them to the database.

please post back to this thread with more questions instead of creating
another new thread on the newsgroup. you have triple-posted this
question already.

vaj wrote:
thanks guys but i dont think i explained the problem correctly,sorry !
the thing im not looking to tranfer the datasets on to the database in
the device but to a remote server.
tried RDA but my sql server isnt compatible with the version of the
server i have on the device.So what me and my colligues thought was to
do a http posting to the serevr.but the problem is non of us know how
to do this.
could any of u tell me how to do this or is there anyother way i can
get this data transferred?
ad*****@yahoo.c om wrote:
vaj wrote:
> Hey,
> Im creating a system on a pocket pc based on win ce 4.2 and i need to
> tranfer three datasets to a remote server on the network.Could anyone
> tell me the easiest way to do this?
> cheers,
> -vaj

Here's a solution that I'm trying to get working on one of my own
projects. It pretty much works, although I don't know if it's a best
practice or anything...(May be some others can weigh in on the overall
approach.)

I'm not sure what the .NET framework looks like on WinCE, but in the
full .NET framework, you can get a dataset containing just
updated/changed data with something like:

dsModified = dsModified.GetC hanges()

See the docs on .GetChanges for a fuller explanation of some options
there.

Then you take that dataset and pass it to a web service, which has a
web method that accepts a dataset as a parameter, and merges it with a
dataset containing the latest data from the server (da = data adapter,
ds = dataset):

sql = "SELECT NameFirst, NameLast FROM tblContacts"
cn = DBConnect()
cn.Open()
daOriginal = New SqlDataAdapter( sql, cn)
daOriginal.Fill (dsOriginal)
dsOriginal.Merg e(dsModified)

Then you write the data to the database:

daOriginal.Upda teCommand = cmd.GetUpdateCo mmand()
daOriginal.Upda te(dsOriginal)

We've had to do some other things like explicitly setting the primary
key on dsModified to match the pkey on dsOriginal, but that might be
due to some conversions to and from XML and old-style ADO recordsets we
do between the various layers of the app.

If nothing merges in, it may be because the rowstate of the dateset
rows have been set back to "unchanged" as it came into the web service.
In ADO.NET 2.0, you can apparently manually set the rowstate of the
rows.

The MSDN on .Merge is pretty helpful, although it doesn't seem to
recommend using Merge for this purpose.


Jun 30 '06 #6

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

Similar topics

4
2608
by: Frnak McKenney | last post by:
I'm using an in-core DataSet as an image of my application's 'database' (a multi-table Access97 mdb file). Updates are made to the DataTables within the DataSet via forms with bound TextBoxes, then written to the database... or at least that's what's supposed to be happening. Unfortunately, I've discovered that while it appears that when...
5
1817
by: Grant | last post by:
Hello, How come when I add a new row to my dataset table it shows up as changed (agencyData.Haschanges() = True) but when I delete a row the dataset thinks here are no changes(agencyData.Haschanges() = False)???? The bizaar thing is the row count before the delete and after is different so it definately is being deleted but I cannot...
1
2852
by: Asha | last post by:
greetings, i've manually created a dataset which contains data input from users. i validate the dataset against the business logic and once everything is done, i would like to save the values in the dataset into the database. the database has 5 columns and so does my dataset. my dataset has all the same name field name and datatype as the...
22
4210
by: EMW | last post by:
Hi, I managed to create a SQL server database and a table in it. The table is empty and that brings me to my next chalenge: How can I get the info in the table in the dataset to go in an empty SQL table? Is there a short way like the FILL method to get data into the dataset or do I have to read each datarow in the table and write it...
0
7720
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. ...
1
7475
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...
0
7812
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...
1
5372
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
5089
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
3501
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
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1944
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
0
766
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.