Strongly typed dataset for hierarchical data

Hi all,

I'm trying to create a simple XML structure for storing tree-stryle data for 
a forum-like software, e.g. each post will have a body field, the ID of the 
user who posted the message, and zero or more subposts(replies). Thus it 
would allow for unlimited depth of subposts.

I also need a simple table to store UserID, Full Name, etc of the users 
posting messages.

I've created a schema in VS.NET 2003 as follows. However, now I need to add 
a relation between ID field of User table and UserID field of Post table 
(one-to-many). If I try to add such relation, I get "Failed to add data 
relation. Exception has been thrown by the target of an invocation."

Any help is greatly appreciated.

----------------------
<?xml version="1.0" encoding="utf-8" ?>

<xs:schema id="DsPost" targetNamespace="http://tempuri.org/DsPost.xsd" 
elementFormDefault="qualified"

attributeFormDefault="qualified" xmlns="http://tempuri.org/DsPost.xsd" 
xmlns:mstns="http://tempuri.org/DsPost.xsd"

xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

<xs:element name="DsPost" msdata:IsDataSet="true">

<xs:complexType>

<xs:choice maxOccurs="unbounded">

<xs:element name="Post">

<xs:complexType>

<xs:sequence>

<xs:element name="Body" type="xs:string" minOccurs="0" />

<xs:element name="UserID" type="xs:int" minOccurs="0" />

<xs:element name="Post" type="PostType" minOccurs="0" />

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="User">

<xs:complexType>

<xs:sequence>

<xs:element name="ID" type="xs:int" minOccurs="0" />

<xs:element name="Name" type="xs:string" minOccurs="0" />

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:choice>

</xs:complexType>

<xs:key name="DsPostKey1" msdata:PrimaryKey="true">

<xs:selector xpath=".//mstns:User" />

<xs:field xpath="mstns:ID" />

</xs:key>

</xs:element>

<xs:complexType name="PostType">

<xs:sequence>

<xs:element name="Body" type="xs:string" minOccurs="0" />

<xs:element name="UserID" type="xs:int" minOccurs="0" />

<xs:element name="Post" type="PostType" minOccurs="0" />

</xs:sequence>

</xs:complexType>

</xs:schema>


0
oleg8027 (3)
11/2/2004 8:39:06 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
570 Views

Similar Articles

[PageSpeed] 36

Nevermind. Once I clicked OK and Submit again, it worked. I guess there is a 
bug in VS.NET.

-Oleg.

"Oleg Ogurok" <oleg@ogurok.com.ihatespammers.ireallydo.co> wrote in message 
news:10ofs5eef41kqc6@corp.supernews.com...
> Hi all,
>
> I'm trying to create a simple XML structure for storing tree-stryle data 
> for a forum-like software, e.g. each post will have a body field, the ID 
> of the user who posted the message, and zero or more subposts(replies). 
> Thus it would allow for unlimited depth of subposts.
>
> I also need a simple table to store UserID, Full Name, etc of the users 
> posting messages.
>
> I've created a schema in VS.NET 2003 as follows. However, now I need to 
> add a relation between ID field of User table and UserID field of Post 
> table (one-to-many). If I try to add such relation, I get "Failed to add 
> data relation. Exception has been thrown by the target of an invocation."
>
> Any help is greatly appreciated.
>
> ----------------------
> <?xml version="1.0" encoding="utf-8" ?>
>
> <xs:schema id="DsPost" targetNamespace="http://tempuri.org/DsPost.xsd" 
> elementFormDefault="qualified"
>
> attributeFormDefault="qualified" xmlns="http://tempuri.org/DsPost.xsd" 
> xmlns:mstns="http://tempuri.org/DsPost.xsd"
>
> xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
>
> <xs:element name="DsPost" msdata:IsDataSet="true">
>
> <xs:complexType>
>
> <xs:choice maxOccurs="unbounded">
>
> <xs:element name="Post">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element name="Body" type="xs:string" minOccurs="0" />
>
> <xs:element name="UserID" type="xs:int" minOccurs="0" />
>
> <xs:element name="Post" type="PostType" minOccurs="0" />
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:element>
>
> <xs:element name="User">
>
> <xs:complexType>
>
> <xs:sequence>
>
> <xs:element name="ID" type="xs:int" minOccurs="0" />
>
> <xs:element name="Name" type="xs:string" minOccurs="0" />
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:element>
>
> </xs:choice>
>
> </xs:complexType>
>
> <xs:key name="DsPostKey1" msdata:PrimaryKey="true">
>
> <xs:selector xpath=".//mstns:User" />
>
> <xs:field xpath="mstns:ID" />
>
> </xs:key>
>
> </xs:element>
>
> <xs:complexType name="PostType">
>
> <xs:sequence>
>
> <xs:element name="Body" type="xs:string" minOccurs="0" />
>
> <xs:element name="UserID" type="xs:int" minOccurs="0" />
>
> <xs:element name="Post" type="PostType" minOccurs="0" />
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:schema>
>
> 


0
oleg8027 (3)
11/3/2004 8:26:50 PM
Reply:

Similar Artilces:

File type converter install
I've received a docx file (Word 2007-type). My Word is 2000, so I can't open it. So I've downloaded a MS converter but when I try to install it, although it says 'satisfactorily installed' it's nowhere to be found so that I can actually use it. I would expect it to be listed in All Programs and/or to have its own desktop icon. Anyone any answers for me? You may say this should be queried on a Word NG, but I thought it more appropriate to ask on a Windows NG. Rob Graham Rob Graham <rttgraham@btinternet.com> �crivait news:1NidnSZoEImDiz_WnZ2dnUVZ...

How to obtain the type of the exception in 'catch (...)'?
Hi. Sorry, but I couldn't find a more appropriate group for this question; once I've been mistaken, posting it to the comp.lang.c++... I need to identify the type of the exception in the universal handler (catch (...)) for debugging purposes. Point is that I write a testing console application, which must call some functions from a DLL. One of these functions throws an exception, and since my small application knows nothing about the exception type system of that DLL application, the generated exception always caught in 'catch (...)'. I've made some small investigations: i...

Piping data to other office applications
Hello, Is there a way to have flat file format "table" data on one worksheet automatically fill data into an MS Word document's "field" areas? I can build this "report" in excel using simple vlookups and a scrolling selector for the "unit number", but piping the same data over to the currently accepted form(s) would be cool. I know this is probably not the exact correct group for this, but doing it via a macro would likely be the next logical step, so... Hi Rather than using vb to bring the data in where the formatting can be...

synching data between Outllook and PDA with PalmOS
I've got a Palm-OS based PDA (a Handspring Visor, running Palm OS version = 3.5.2H1.5 to be exact). I've been synching my Outlook data between my Windows-PC and the PDA for a few years and it has worked well. (Outlook is full Outlook from Office 2000) Now I'm exploring an issue relating to just HOW MUCH of each type of Outlook data gets moved to the PDA. There seem to be builtin LIMITS on how much data goes from the PC into the PDA, which makes perfect sense, as the Palm-OS relatively has LIMITED amount of data-storage. I notice specifically that for each NOTE in Outlook, when ...

How to change order of drop lines relative to the plotted data in Excel 2007 chart
What is the procedure for changing the order of drop lines relative to the plotted data in an Excel 2007 chart? I would like the chart;s drop lines to remain active, but appear "sent to the back" behind the plotted data. I attempted to help myself by searching extensively, but I was unable to find the solution. I think it may require a VBA entry, but, if so, I will require assistance. Are the references below pointing me in the right direction? http://msdn.microsoft.com/en-us/library/bb210119.aspx http://msdn.microsoft.com/en-us/library/bb216878.aspx http://m...

Questions about the Data Migration Framework
Hello, I try to use the Data Migration Framework and during population of the CDF-Database I run in a problem which I would like to discuss. The task is quite simple but I found the DMF to be the most suitable solution to it. We want to remove the leads from our database and only run contacts and customers. We found that our organization doesn't need the separation of Leads and Customers in the sense CRM sees it. We will set the status of a contact/account via a customized field. So in an Access-Database I set links to the CRM-tables for Lead and Annotation. Also I set links to the CDF-...

UK Fantasy Football Player Data?
Hi, Does anyone know where I can get hold of excel spreadsheets with player data for the forth coming UK Fantasy Football season? -- Rich http://www.ukfantasyfootball.info ...

Summarizing data from one worksheet to another
This is (hopefully) an easy question (with an easy answer), but I'm not having much luck figuring it out on my own. I've got a workbook that consists of two worksheets: Data and Summary. Column A of Data is a user-enterable column called "Date" Column B of Data is a user-enterable column called "Task" Column C of Data is a user-enterable column called "Total" The user will enter the data in any order, and there will be many repeats of each "Task" they enter. On the second worksheet, I want to be able to display a list of each unique Task t...

Creating a botton to update data from a Form to Table
Greetings People I need to know how to create a botton on a Form (Microsoft Access) that may allow me to update the data in a Table. I know that I have to use VBA or VB ..NET CODE to create it. Where could I find a sample code that may help me with that? Reboot Kid On Tue, 11 May 2010 16:19:01 -0700, Reboot the Kid <ReboottheKid@discussions.microsoft.com> wrote: >Greetings People > >I need to know how to create a botton on a Form (Microsoft Access) that may >allow me to update the data in a Table. I know that I have to use VBA or VB >.NET CODE to c...

How to clear all data in Outlook and start over
I had trouble with my pocket pc and Activesync. I need to erase all the "stuff" in Outlook and sync my pocket pc again. I can't find a way to clear all the entries -- other than one entry at a time. Are there folders for each area, e.g., Contacts, Notes, and Calendar? Bill With Outlook closed, rename your .pst file to something like .old (saves time if you need it back). Then go to control panel, mail icon, create a new mail profile with a new .pst file. -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. How to ask a questio...

How do I export data from Excel as a series of comma-separated val
I am using Excel 2000. I entered my data in a spreadsheet, and saved it as a CSV file. Now I need to change it to comma-separated values and send it in an e-mail. Here's an example of what I am doing. Swamp Thing 1972 1 FN 1 None None 24.5 Now I need that to be separated by commas instead of cells. Also, it took out my dollar signs and zeros, and I want them back. What do I do? I use Excel 2003 File|Save As , select file type as CSV file. Then open *.csv with text editor not Excel. You example data will look as below: Swamp Thing, 1972, 1, FN, 1, None ,...

How do I break a chart data range
Most values in my chart are under 200000 but I have one that's 1.3 million which makes the others look tiny and unreadable. Is there a way to break the range to show the large value and the smaller values closer together? Hi have a look at http://www.tushar-mehta.com/excel/newsgroups/broken_y_axis/index.html http://peltiertech.com/Excel/Charts/axes.html#Broken -- Regards Frank Kabel Frankfurt, Germany Tara wrote: > Most values in my chart are under 200000 but I have one that's 1.3 > million which makes the others look tiny and unreadable. Is there a > way to break the range...

strange type in outlook email
In my Outlook 2003 everytime I type an email, it keeps showing all sorts of strange characters. Everytime I press space, a dot appears and likewise everytime I press the space button, I get the symbol for a paragraph. It has started all of a sudden and I can't find an answer in Help to get it off. How do I get it to stop doing this? Sounds like you need to turn off the option to show formatting in Word and you're using Word as your email editor. If so, open Word, go to the Tools menu > Options command and uncheck the options on the View tab "zakropotch" <z...

How to type email addresses without the underline and blue print?
I am creating a school directory and some of the addresses have underscores. So I want it to print with the automatic blue printing and underline. This will be in the form of a hard copy only. Thank You Your subject line says you want the address without blue and underscore but your messages says you want the blue and underscore. ?????? Lets go with making it blue with underscore. Highlite the address, change the font color to blue and select the underscore button. -- Don Vancouver, USA "Grace" <Grace@discussions.microsoft.com> wrote in message news:7854A597-914F-4...

Breaking up data
I have, at this time, a simple table containing data in ONE field. The next line is a sample of this data. CLASS 00000340:SEALANT/CAULKING I would like to split this data into two fields ..... the first one containing CLASS up to and containing the colon and the second containing the remainder. While I'm sure this has been addressed before I can't seem to come up with the correct input for the search criteria in the knowledgebase. Any help appreciated. On Sat, 20 Oct 2007 14:29:44 -0700, TeeSee wrote: > I have, at this time, a simple table containing data in ONE field. The > n...

Using Acces data in to send personalized letter
we have created an access database with names address etc; the input screen works ok for these fields BUT we want to be able to input the required data then have extra buttons that will allow the printing of a personalized letter for the data just input/onscreen and save it at the same time, and a separate button incase we just want ot save but not print. Sorry if you guys think it's simple but we are very new to this. Regards Adrian Hi Adrian, There are a number of ways you could print a personalized letter. You could create a Report each time and copy the record data to the relev...

remove "type question for help" in SBE
Hi, Anyone know how to remove the thing that says "type question for help" in Excel SBE? Thanks KB wrote: > Hi, > > Anyone know how to remove the thing that says "type question for help" > in Excel SBE? Thanks Never mind. I found it. Never fails that AFTER I ask, I find it. Thanks anyway. Here it is if anyone needs it: 1. On the Tools menu, click Customize. 2. On the menu bar, right-click the Type a question for help Question Box image box. 3. Select or deselect Show Ask A Question Box to show or hide it. Note If you are hiding the Type a...

http://DuplicateFilesDeleter.com
http://DuplicateFilesDeleter.com - This software deletes duplicate files in media collection of any type 1. Quick search for file duplicates by their contents no matter what their file names are. 2. It is possible to find file duplicates only by file names. 3. Searching for duplicate music files (mp3) by an mp3 tag. It is possible to compare tracks by artist, name, album, year, comment, genre. Or by several tags at a time. 4. Searching for similar images. 5. Searching ZIP and RAR archives. 6. Searching for file duplicates in certain folders. It is also possible to specify folders that should ...

Importing Binairy Fixed length data.
Hello, At the moment I am investigating how to import data from a legacy database. One off the methods we are considering is importing: Binairy Fixed Length data. ================== This data can be supplied in files. Is it possible with SSIS to import this data into tables? Importing each record (of fixed length up to 512 bytes) into a single field in a table would be sufficient. Suggestions? Webpages pointing in the right direction? *) Some numbers. The binairy data is never long. Most 'records' have a fixed length of less than 512 bytes. Each byte can contai...

Data Security & Flash Drive Formatting
Last week I placed some sensitive files on a flash drive for a brief period (two or three hours) before deleting them. At this point, I'd like to make sure that these deleted files CANNOT be recovered, and I know there are tools out there that *can* restore deleted files. I need to make sure that any such tools will NOT be able to recover the files in question. So, I'm wondering if a "low-level" format operation would flip all the 1's to 0's (so to speak), such that these files would be certainly unrecoverable. Would formatting do the trick? And wo...

Data Mapping between Applications.
Hello, Could anyone please throw your suggestions on the following scenario? (It would be really helpful if you could provide a solution using ..NET,XSLT,XSD,Web Service other than 'Biztalk Server' Approach.) - Honestly speaking, I am new to this Data Exchanging Process, though I have some knowledge in XML,XSLT,Webservice,C#,ASP.net etc. In my project, there is a need to design an interface to handle data exchange between two applications using XML, XSLT ,XSD,.NET , Web Services,etc . Business rule: -------------- Let us say, The data in a XML file from Application A(Destinat...

How to compare two column of data and sort them out according
Hi, I have this problem, What i have on hand is two column of data containing part number of two different devices. What i am trying to do is to compare this two column and find out all the part number that is common to both device and also which part number is unique. And organise and display this in excel. Anyone know any way to accomplish it please help. -- kuansheng ------------------------------------------------------------------------ kuansheng's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30658 View this thread: http://www.excelforum.com/showthread.p...

Import Data: on insert, shift data down and not right
Hi, I'm importing data from an external source (notes database). The data is being put in between different rows which have existing data. The problem I'm stuck with is that on the insert of the data, I would like an existing data to moved downwards but instead it's being moved to the right. I.e. the colums are shifting right whereas I would like the rows to be moved down. Can anyone please help with this. Thanks Lena It's not clear how you're doing this "insert" of data. Importing data typically brings it in as a block, either in a new workbook or in a...

Comparing data intervals
If 2 observers collected data, what formula would be needed to count the total number of intervals (potentially 30 intervals) observer 1 agreed with observer 2. Observer 1 will enter data (1-5) on row 3 (cells T3-AW3) Observer 2 will enter data (1-5) on row 4 (cells T4-AW4) In other words, how many times does T3=T4, does U3=U4, etc.? Is there a short formula to use without having to identify all 30 intervals? =sumproduct(--(t3:aw3=t4:aw4)) May work for you. smoutsat wrote: > > If 2 observers collected data, what formula would be needed to count the > total number of interva...

Replace old data
I'm working on a simple program that enabled the user to Search and Edit the data. The user has 2 options whether to save the data as a new record or to replace the existing data. I managed to get the job done for the user to SAVE AS NEW RECORD by using this coding : ActiveCell.Value = txtSpecificationNo.Value ActiveCell.Offset(0, 1) = txtIssueNo.Value ActiveCell.Offset(0, 2) = lblPly1.Caption ActiveCell.Offset(0, 3) = txtQtyPly.Value ActiveCell.Offset(0, 4) = txtCodePly.Value ActiveCell.Offset(0, 5) = txtLengthPly.Value ActiveCell.Offset(0, 6) = txtWidthPly.Value ActiveCell.Offset(0, 7)...