Click here to Skip to main content
15,895,423 members
Home / Discussions / Database
   

Database

 
GeneralRe: query inside a dataset Pin
fuel2run29-May-04 2:55
fuel2run29-May-04 2:55 
GeneralRe: query inside a dataset Pin
ekolis29-May-04 9:15
ekolis29-May-04 9:15 
GeneralRe: query inside a dataset Pin
fuel2run29-May-04 22:14
fuel2run29-May-04 22:14 
GeneralRe: query inside a dataset Pin
ekolis30-May-04 15:50
ekolis30-May-04 15:50 
GeneralRe: query inside a dataset Pin
fuel2run30-May-04 23:55
fuel2run30-May-04 23:55 
GeneralRe: query inside a dataset Pin
ekolis31-May-04 13:54
ekolis31-May-04 13:54 
GeneralRe: query inside a dataset Pin
fuel2run31-May-04 22:02
fuel2run31-May-04 22:02 
GeneralProblems porting a DataSet from SQL Server to XML Pin
Jordan Breckenridge24-May-04 6:23
Jordan Breckenridge24-May-04 6:23 
I have an application with a typed dataset. The application works fine if I fill the dataset from a SQL Server connection. However, recently, I've been trying to change the application so that it reads from an XML file. This was supposed to be easy, but its turning out not to be.

I instantiate my dataset subclass, load the data from the database, and then write the XML using the WriteXML (outfilename, System.Data.XmlWriteMode.WriteSchema) to create an XML file with Schema. My plan is to save this file off and not use a database for production hosting because my application isn't really transactional (trying to save some hosting costs). Creating the file is no sweat.

However, when I try to read file into a DataSet using ReadXML and an explicit System.Data.XmlReadMode.ReadSchema, I get an ""Invalid 'key' node inside constraint named: [Constraint Name]"" exception. I've scoured the web and the schema to see if I can identify something wrong, but I haven't found anything of note.

On one post, someone suggested changing the msData:isDataSet flag in the schema from ""True"" to ""False"". I'm not sure I understand the logic, but I tried this. I read the file, but I get different errors (see below for a summary of the scenarios).

On MSDN I saw a note that there is a known bug with row states on XML-based datasets and you should copy the dataset prior to binding it to work around the problem. This seems to do something, but again, I get different errors.

I've tried every scenario I can think of: Reading vs. Ignoring the Schema, Changing ""IsDataSet"" between False and True, and copying vs. not copying prior to binding. Here are my results:

(1) Read Schema; IsDataSet=True -- Results in: Invalid 'key' node inside constraint named: [Constraint Name]"" exception
(2) Read Schema; IsDataSet=False; Copy Prior to Bind -- Results in: The name '[DataSetName]' is invalid. A datatable cannot have the same name of the dataset.
(3) Read Schema; IsDataSet=False; Don't Copy Prior to Bind -- Results in: Application runs, but the result is an empty datalist.
(4) Ignore Schema; IsDataSet=True; Copy Prior to Bind -- Results in: Object reference not set to an Instance of an object when a DataView is bound to the DataList.
(5) Ignore Schema; IsDataSet=True; Don't Copy Prior to Bind -- Results in: Application runs, but the result is an empty datalist.
(6) Ignore Schema; IsDataSet=False; Copy Prior to Bind -- Results in: Object reference not set to an Instance of an object when a DataView is bound to the DataList.
(7) Ignore Schema; IsDataSet=False; Don't Copy Prior to Bind -- Results in: Application runs, but the result is an empty datalist.

Again, the application works fine if I load the DataSet from the database. Its just when I use the ReadXML methods that it doesn't work. Can anyone suggest anything else that I should be trying?

Thanks,
Jordan
GeneralADO and Excel File Pin
bigBA24-May-04 1:45
bigBA24-May-04 1:45 
GeneralRe: ADO and Excel File Pin
-Dr_X-26-May-04 17:17
-Dr_X-26-May-04 17:17 
GeneralDBase file table names Pin
IJay24-May-04 0:27
IJay24-May-04 0:27 
GeneralProblem connecting to sql with C# and ASP.NET Pin
Aviv Halperin23-May-04 10:38
Aviv Halperin23-May-04 10:38 
GeneralRe: Problem connecting to sql with C# and ASP.NET Pin
Grimolfr24-May-04 3:30
Grimolfr24-May-04 3:30 
GeneralConnection String for Database access Pin
Ali Alaradi22-May-04 19:55
Ali Alaradi22-May-04 19:55 
GeneralRe: Connection String for Database access Pin
Hesham Amin23-May-04 11:12
Hesham Amin23-May-04 11:12 
GeneralSQL Pin
Member 110684620-May-04 21:02
Member 110684620-May-04 21:02 
GeneralRe: SQL Pin
Hesham Amin20-May-04 21:48
Hesham Amin20-May-04 21:48 
Generaltext to ntext Pin
ShankarPS20-May-04 16:59
ShankarPS20-May-04 16:59 
GeneralRe: text to ntext Pin
Grimolfr21-May-04 4:17
Grimolfr21-May-04 4:17 
GeneralRe: text to ntext Pin
ShankarPS23-May-04 19:54
ShankarPS23-May-04 19:54 
GeneralRe: text to ntext Pin
Grimolfr24-May-04 4:36
Grimolfr24-May-04 4:36 
GeneralDataTable Pin
IamADotNetGuy20-May-04 10:35
IamADotNetGuy20-May-04 10:35 
GeneralRe: DataTable Pin
Jackiemcki25-May-04 12:39
Jackiemcki25-May-04 12:39 
GeneralSQL Server Pasword Changing Pin
Imtiaz Murtaza19-May-04 21:09
Imtiaz Murtaza19-May-04 21:09 
GeneralRe: SQL Server Pasword Changing Pin
Aryadip19-May-04 21:36
Aryadip19-May-04 21:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.