Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dbf to xml
Message
From
30/11/2006 11:06:57
 
 
To
30/11/2006 01:07:46
General information
Forum:
ASP.NET
Category:
Other
Title:
Environment versions
Environment:
VB 8.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01173564
Message ID:
01173736
Views:
8
Well, sorry Ryan, but I gave you C# code (sorry, didn't notice you were using VB), but you can probably figure out the correct VB syntax (it would be only slightly different) ... use this converter if you can't:

http://www.carlosag.net/Tools/CodeTranslator/

Secondly, you can put the code anywhere you like. I don't know anything about what type of processing you are doing, but putting it in the Form Load is probably ok. (Personally, I *never* put data access code directly into my Forms, but seeing as you're new to this and you are probably just testing things out, then it's ok. I wouldn't do it in a real application though.)

~~Bonnie



>Hi Bonnie,
>
> thanks for quick reply, im new in vb.net where do i put this code?
>
>Public Class Form1
>    Inherits System.Windows.Forms.Form
>
>Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
>        string TestConnection = "server=(local);database=MyDataBase;uid=sa;pwd=MyPassword";
>        SqlDataAdapter da = new SqlDataAdapter("select * from bob", this.TestConnection);
>        MyDataSet ds = new MyDataSet();
>        da.Fill(ds, "MyTable");
>        ds.WriteXml("MyData.xml");
>    End Sub
>End Class
>
>
>
>
>>Ryan,
>>
>>Read the data into a Typed DataSet based on your .xsd. Then simply use the WriteXml() method of the DataSet.
>>
>>
>>string TestConnection = "server=(local);database=MyDataBase;uid=sa;pwd=MyPassword";
>>SqlDataAdapter da = new SqlDataAdapter("select * from bob", this.TestConnection);
>>MyDataSet ds = new MyDataSet();
>>da.Fill(ds, "MyTable");
>>ds.WriteXml("MyData.xml");
>>
>>
>>~~Bonnie
>>
>>
>>
>>>Hi to All,
>>>
>>>
>>> how to export dbf file to xml data file i have a schema(xsd file) for the xml.
>>>
>>>TIA
>>>ryan.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform