PC Review


Reply
Thread Tools Rate Thread

DatSet, XML and Type DataSet transfer data

 
 
=?Utf-8?B?S1BI?=
Guest
Posts: n/a
 
      18th Mar 2004
Hi All

I'm developing ADO .NET application.

I have dataset inside my code and I write an XML file from my dataset.
After that, I write program test to create type dataset from that XML file. I create new type dataset and use ReadXml method to load data from an XML file but there is an error occur. I try to use normally dataset and use ReadXml method to load data, it success

Is there anybody can help me solve this problem?
Or introduce me what should I do if I need to use type dataset and an XML file with my program

Thanks
KP

 
Reply With Quote
 
 
 
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      19th Mar 2004
Hi KPH,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you use ReadXml to import data
from an Xml file which was exported from an untyped DataSet, it fails.
However, if the target DataSet is an untyped one, it succeeded. If there is
any misunderstanding, please feel free to let me know.

Based on my experience, this might happen when the original data in the Xml
file doesn't meet the schema of the target typed DataSet. If there are
UniqueConstraint, ForeignKeyConstraint or PrimaryKey set in the target
DataSet, importing data which break these constraints can result in
exceptions.

So please check the schema of the typed DataSet. If that still doesn't
solve the problem, could you please paste your exception message here?

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
=?Utf-8?B?S1BI?=
Guest
Posts: n/a
 
      19th Mar 2004
Hi

Thank you for your advise

Yes I ceate xml file from untyped dataset. After that I create type dataset from that xml file with .NET IDE tool. So I try to read that xml file to typed dataset but no row affect. I change my typed dataset to untype dataset and try to read that xml file again, it work there are row in table of dataset

Why no row in my table of my typed dataset

Thanks
KPH
 
Reply With Quote
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      20th Mar 2004
Hi KPH,

As I mentioned in my last post, the typed DataSet might contain some
constraints in the schema. Data which violates these constraints will not
be added. For example, if we have defined a primary key in a table. The
table already contains a row whose primary key is 1. When we are trying to
add another row which has the same primary key value, an error occurs. If
the problem persists, could you please paste your exception message here?
Or could you paste your DataSet schema and the Xml file here? Thanks for
your cooperation!

For more information about constraints, please check the following link.

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdataconstraintclasstopic.asp

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataSet transfer data from one database to another =?Utf-8?B?TGlzYUNvbnN1bHQ=?= Microsoft ADO .NET 14 4 Weeks Ago 06:53 AM
Unable to cast object of type 'System.Data.DataSet' to Typed DataSet Optimus Microsoft VB .NET 1 31st Jan 2006 06:26 AM
efficient data type to transfer data from managed to unmanaged =?Utf-8?B?R2VSbUlj?= Microsoft C# .NET 1 8th Aug 2004 03:39 PM
Transfer data from Access to SQL Server by DataSet problems... =?Utf-8?B?QW50b24=?= Microsoft ADO .NET 2 17th Feb 2004 01:48 PM
The argument type System.Data.DataSet cannot be converted into parameter type Sy Paul Warnk Microsoft Dot NET Framework 1 13th Aug 2003 11:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:00 AM.