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

writexmlschema not working

i have used the following code(which is straight from the msdn) to try this
: how ever this and anyother method that i have tried only give me a

An unhandled exception of type 'System.InvalidCastException' occurred in
system.data.dll

Additional information: Specified cast is not valid.

does anyone have any ideas on what is going wrong?

WStoreyII

Thanks again

Private Sub WriteSchemaWithXmlTextWriter(thisDataSet As DataSet)
' Set the file path and name. Modify this for your purposes.
Dim filename As String = "mySchema.xml"
' Create a FileStream object with the file path and name.
Dim myFileStream As New System.IO.FileStream _
(filename, System.IO.FileMode.Create)
' Create a new XmlTextWriter object with the FileStream.
Dim MyXmlTextWriter As New System.Xml.XmlTextWriter _
(myFileStream, System.Text.Encoding.Unicode)
' Write the schema into the DataSet and close the reader.
thisDataSet.WriteXmlSchema(MyXmlTextWriter)
MyXmlTextWriter.Close()
Nov 20 '05 #1
4 2311
Hi WS,

I have seen the sample too, however I that stream does nothing in my
opinion, can you try if this fits you?

Cor
..
Private Sub WriteSchemaWithXmlTextWriter(thisDataSet As DataSet)
thisDataSet.WriteXmlSchema("MyPath")
End Sub
Nov 20 '05 #2
Hi WS,

I have seen the sample too, however I that stream does nothing in my
opinion, can you try if this fits you?

Cor
..
Private Sub WriteSchemaWithXmlTextWriter(thisDataSet As DataSet)
thisDataSet.WriteXmlSchema("MyPath")
End Sub
Nov 20 '05 #3
that works

but the reason it wasnt working before i figrued out was because i was using
a custom inherited dataset and i guess that i had not programed that code in
so it did not work

but the msdn tutorials a lot of them dont work its like they are made in a
earlier version of vb.net

thanks again for your help

wstorey?

"Cor Ligthert" <no*@planet.nl> wrote in message
news:uY**************@tk2msftngp13.phx.gbl...
Hi WS,

I have seen the sample too, however I that stream does nothing in my
opinion, can you try if this fits you?

Cor
.
Private Sub WriteSchemaWithXmlTextWriter(thisDataSet As DataSet)
thisDataSet.WriteXmlSchema("MyPath")
End Sub

Nov 20 '05 #4
that works

but the reason it wasnt working before i figrued out was because i was using
a custom inherited dataset and i guess that i had not programed that code in
so it did not work

but the msdn tutorials a lot of them dont work its like they are made in a
earlier version of vb.net

thanks again for your help

wstorey?

"Cor Ligthert" <no*@planet.nl> wrote in message
news:uY**************@tk2msftngp13.phx.gbl...
Hi WS,

I have seen the sample too, however I that stream does nothing in my
opinion, can you try if this fits you?

Cor
.
Private Sub WriteSchemaWithXmlTextWriter(thisDataSet As DataSet)
thisDataSet.WriteXmlSchema("MyPath")
End Sub

Nov 20 '05 #5

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

Similar topics

0
by: Jose Antonio | last post by:
Hi, I am writing an app which reads a SQL Server schema, configures a dataset with that information and finally writes the xsd schema to a file. The problem is that the resulting xsd file...
3
by: MSSQLServerDeveloper | last post by:
I have a simple vb.net program that creates an xmlschema using the dataset method writexmlschema (see #1). It creates a file (see #2), but I would like a file that looks like #3 - #3 is DIFFERENT...
2
by: Gary | last post by:
I am trying to use the "System.Windows.Forms.SendKeys" class for triggering the Ctrl+P key. Syntax: System.Windows.Forms.SendKeys.Send("^(P)"); This is not working ..what could be the...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
2
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but...
4
by: WStoreyII | last post by:
i have used the following code(which is straight from the msdn) to try this : how ever this and anyother method that i have tried only give me a An unhandled exception of type...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
0
radcaesar
by: radcaesar | last post by:
I was saving the schema of a dataset using Dataset.WriteXmlSchema. I am getting the result like this <?xml version="1.0" standalone="yes"?> <xs:schema id="NewDataSet" xmlns=""...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.