473,408 Members | 1,739 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,408 software developers and data experts.

Trying to load a dataset

1 I load a text file into a dataset, after doing a bit of work..
2 Now I have a dataset full of data that I like to transfer to a data base
3 My problem is that if the rowstate of the row is set to unchange, nothing
happen!! :( ;
4 Is it posible to load / change this parameter to read Added?
5 Am I doing something wrong / is there another way of transfering a dataset
to a database, appart from saving to xml then load it to the db?

Thanks for any help

jaime
Nov 15 '05 #1
4 3846
Jamie,

When importing your data, you can read the dataset in, but then you will
have to create a copy and then copy the rows over to the new data set. The
reason for this is because you can not change the RowState property (which
would be very, very helpful, I agree).

Then, perform your processing and then insert into the database.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"jaime" <j.******@ntlworld.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
1 I load a text file into a dataset, after doing a bit of work..
2 Now I have a dataset full of data that I like to transfer to a data base
3 My problem is that if the rowstate of the row is set to unchange, nothing happen!! :( ;
4 Is it posible to load / change this parameter to read Added?
5 Am I doing something wrong / is there another way of transfering a dataset to a database, appart from saving to xml then load it to the db?

Thanks for any help

jaime

Nov 15 '05 #2
Nicholas Paldino [.NET/C# MVP] wrote:
Jamie,

When importing your data, you can read the dataset in, but then you will
have to create a copy and then copy the rows over to the new data set. The
reason for this is because you can not change the RowState property (which
would be very, very helpful, I agree).

Then, perform your processing and then insert into the database.

Hope this helps.


Sorry for intrusion and tiny knowledge, but how can a text file be
loaded into a DataSet? If it is done throught DataAdapter then you may
use it's property AcceptChangesDuringFill. Mybe there is some other
means (excluding, of course, hand-adding, wich does not produce such
problems) to load a text file?

Dmitry.

Nov 15 '05 #3
Dmitry,

The original poster probably used the WriteXml method on the DataSet to
write to a stream (a FileStream probably) which is then persisted to disk.
Later, the stream can be opened and read through the ReadXml method.

Also, the ReadXml and WriteXml methods take a filename argument which
will get the contents that have been persisted to a file.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dmitry Baibakov" <ro**@hotbox.ru> wrote in message
news:eS**************@TK2MSFTNGP11.phx.gbl...
Nicholas Paldino [.NET/C# MVP] wrote:
Jamie,

When importing your data, you can read the dataset in, but then you will have to create a copy and then copy the rows over to the new data set. The reason for this is because you can not change the RowState property (which would be very, very helpful, I agree).

Then, perform your processing and then insert into the database.

Hope this helps.


Sorry for intrusion and tiny knowledge, but how can a text file be
loaded into a DataSet? If it is done throught DataAdapter then you may
use it's property AcceptChangesDuringFill. Mybe there is some other
means (excluding, of course, hand-adding, wich does not produce such
problems) to load a text file?

Dmitry.

Nov 15 '05 #4


Dimitry,
Sorry didn't replay before.
I usually load file to SqlServer then work with then there or on the way
to it's final destination.
To check if the dataset is empty you could see the row count of the
first table, check the RowState and use the adaptor, this will only work
with rows that have this state to something different to Unchange.
I am loading a text file to a dataset then this dataset can be save to
sqlServer, if you need help on this let me know and I'll send some
samples.
But have a look at this utility from Microsoft
http://msdn.microsoft.com/vcsharp/do...ault.aspx?pull
=/library/en-us/dnbda/html/daab-rm.asp
It may explain some of the staff you want.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #5

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

Similar topics

6
by: Shabam | last post by:
A web application of mine developed using C# + MS SQL runs fine normally. However when I stress test it with a load testing software (using about 60 simultaneous users) some instances start...
1
by: Tom G | last post by:
The following is a small sample of my XML Data. When I load it to a dataset it only loads the 'Zone' elements and ignores loading the 'Field' elements. <zone id="1234" name="EMPLOYMENT_INFO">...
1
by: Sal | last post by:
Hello all, I am working on a project with the following characteristics: 1. Load data from a SQL server table to an xml file 2. Read the xml file into a dataset. 3. Load data from the...
1
by: Soul | last post by:
Hi, I have a DataGrid which works. But if I load a new table to the DataGrid, it will still show those old data I load earlier. private void loadTableA() { if ( openFileDialog.ShowDialog()...
0
by: BATISTA | last post by:
Hi I have to program in C# such that I have to add a button to the form , and create a crystal report, by getting source from the xml schema file(.xsd file) with two fields namely...
9
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
2
by: john0600 | last post by:
I'm writing a web service in .NET to work with Delphi clients. Delphi uses ADO so I want to convert the Dataset to a Recordset and vice- versa. It appears a Web Service cannot publish a web method...
0
by: newsaboutgod | last post by:
I am loading a dataset from a XML file. I want to allow the user to display data from the dataset in a grid. Depending on which button they click i want to load the grid with a subset of data...
0
by: =?Utf-8?B?TGFzdGJ1aWxkZXJz?= | last post by:
Hi all, I have a weird problem which has been causing me a headache for the last two days. I have to dynamicly generate a schema in memory and load it into a dataset in memory to be returned...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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
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...
0
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...

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.