Save Table From Memory

  • Thread starter Thread starter WStoreyII
  • Start date Start date
W

WStoreyII

I have created a datatable from memory

my question is how is this saved

do i save it to a database file or does vb have a default way of saving a
homemade datatable?

WStoreyII
 
if it's in a data set you can use the writexml method to write it to an xml
file, or if its not in one, you can place it into one and do that
 
WStoreyII:

It's saved by default while it stays in scope. If you want it to be saved
throughout the apps session, put it in a module or a shared property of some
class. If you need to physically store it, you can use Brian's suggestion
of putting it in a DataSet and using DataSet.WriteXML, then use
DataSet.ReadXML to get it back. Remember though that if you want to preserve
rowstate that you'll need to save with Diffgram set, otherwise you'll lose
rowstate which is usually a really bad thing.

HTH,

Bill
 
do i need to know xml to do this(because i dont) or does vb.net do that work
for me?

WStoreyII
 
All you need to do is DataSetName.WriteXML("pathName:\FileName.xml") and to
read it just use DataSetName.ReadXML("PathName:\Filename.xml")

It does all of it for you but you are also confined to its structure. If
you are going to do much in .NET, you'll probably want to take a step back
and learn a bit more about XML (although you don't need it for this
particular task) and Serialization.

HTH,

Bill
 
is xml advanced or is it like html pretty simple?
because it does seem that for vb.net programming you need to know a whole
lot of stuff like
ado.net
asp.net
xml
sql
ect

WStoreyII
 
IMHO, XML is much easier than HTML, but it's not something you can just
remember, it's something you need to understand so you can work it. It's
definitely worth learning and I think you'll find it a lot more thought out
and intuitive than HTML...

If you have any specific questions, let me know.

Bill
 
is xml just for data? do you know a good tutorial that i could look at on
xml?

WStorey

thanks for the help the writexml worked like a charm
 
also how can i convert an excell sheet to xml and or open it into my table
using a dataset???? because i have my ledger finished except for the import
option and i have my old ledger on excel
 
Back
Top