Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
AnswerRe: c# no concept of scope ? Pin
scadaguy5-Sep-03 9:58
scadaguy5-Sep-03 9:58 
GeneralRe: c# no concept of scope ? Pin
jpribele5-Sep-03 10:10
jpribele5-Sep-03 10:10 
GeneralRe: c# no concept of scope ? Pin
leppie5-Sep-03 22:17
leppie5-Sep-03 22:17 
GeneralRe: c# no concept of scope ? Pin
jpribele8-Sep-03 3:09
jpribele8-Sep-03 3:09 
GeneralRe: c# no concept of scope ? Pin
leppie8-Sep-03 8:25
leppie8-Sep-03 8:25 
GeneralRe: c# no concept of scope ? Pin
scadaguy8-Sep-03 3:28
scadaguy8-Sep-03 3:28 
AnswerRe: c# no concept of scope ? Pin
Rich3335-Sep-03 22:58
sussRich3335-Sep-03 22:58 
GeneralCreate DataTable from XML Schema Pin
Douglas Troy5-Sep-03 7:33
Douglas Troy5-Sep-03 7:33 
Here's the deal: I have created an XSD file that relates back to an XML data file. The XML data is EMPTY (no data), only the XML Header, DataSet name and reference to the XSD file comprise the contents of the XML (see below):

<?xml version="1.0" encoding="utf-8" ?>
<MyDataSet> xmlns="http://tempuri.org/MyDataFile.xsd">
</MyDataSet>

I load this XML file into a DataSet object using ReadXML() with the ReadSchema parm. While the XML data file is empty, this read statement succeeds just fine; expected this, it's all good.

Now, I want to add a 'record' into the XML file, so I need to create a new DataTable, but I want to use the schema that's already defined in the XSD for my table (makes sense). In my schema (XSD) file, this record is defined as MyDataRecord (if I view the Schema in designer, I can see the datastructure just fine).

Becase the XML file is empty, doing something like:
DataTable dt = MyDataSet.Tables["MyDataRecord"];
only returns NULL

I thought, perhaps, I could do the following:
DataTable dt = MyDataSet.Tables.Add();
and it would be "smart enough" to create a DataTable object using the schema datastructure, but it does not ...

I need to know how to create a DataTable object of type "MyDataRecord " so I have the complete data structure ...

There has GOT to be a simple way to do this, someone please enlighten me.

TIA.


D.

GeneralRe: Create DataTable from XML Schema Pin
Mazdak5-Sep-03 7:58
Mazdak5-Sep-03 7:58 
GeneralRe: Create DataTable from XML Schema Pin
Douglas Troy5-Sep-03 8:10
Douglas Troy5-Sep-03 8:10 
GeneralRe: Create DataTable from XML Schema Pin
Ernesto Perales Soto5-Sep-03 8:01
Ernesto Perales Soto5-Sep-03 8:01 
GeneralRe: Create DataTable from XML Schema Pin
Douglas Troy5-Sep-03 8:40
Douglas Troy5-Sep-03 8:40 
GeneralRe: Create DataTable from XML Schema Pin
Ernesto Perales Soto5-Sep-03 10:26
Ernesto Perales Soto5-Sep-03 10:26 
GeneralRe: Create DataTable from XML Schema Pin
Douglas Troy8-Sep-03 3:49
Douglas Troy8-Sep-03 3:49 
GeneralCloning Data Tables Pin
afronaut5-Sep-03 6:54
afronaut5-Sep-03 6:54 
GeneralRe: Cloning Data Tables Pin
Ernesto Perales Soto5-Sep-03 7:27
Ernesto Perales Soto5-Sep-03 7:27 
GeneralRe: Cloning Data Tables Pin
afronaut5-Sep-03 8:52
afronaut5-Sep-03 8:52 
GeneralRe: Cloning Data Tables Pin
Arjan Einbu5-Sep-03 23:17
Arjan Einbu5-Sep-03 23:17 
QuestionTracking Remoting Objects - How To? Pin
0siris5-Sep-03 6:45
0siris5-Sep-03 6:45 
AnswerRe: Tracking Remoting Objects - How To? Pin
0siris5-Sep-03 15:04
0siris5-Sep-03 15:04 
GeneralRe: Tracking Remoting Objects - How To? Pin
0siris7-Sep-03 18:52
0siris7-Sep-03 18:52 
GeneralSystem.Runtime.Remoting.Channels.Tcp not found Pin
mikemilano5-Sep-03 6:36
mikemilano5-Sep-03 6:36 
GeneralRe: System.Runtime.Remoting.Channels.Tcp not found Pin
0siris5-Sep-03 6:46
0siris5-Sep-03 6:46 
GeneralRe: System.Runtime.Remoting.Channels.Tcp not found Pin
mikemilano5-Sep-03 6:49
mikemilano5-Sep-03 6:49 
QuestionWhat's the best strategy? Pin
wapgagtp5-Sep-03 6:11
wapgagtp5-Sep-03 6:11 

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.