Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want to store data but how? 1

Status
Not open for further replies.

DigginIt

Programmer
Sep 21, 2003
3
DE
Hi all,
I am new to VB.NET and hope it is simple!

The problem is this I want to make an address book type app. for me and a few friends (I am using this to findout how one distributes programs/apps which require datastorage). But if I base it on a DB i.e. Access or SQL Server my freinds would need a copy of the db, i.e. have access or SQL Server running.
Is this correct or can I some how just give them the tables they need??

If this is correct is there some way of using flat files with VB.NET? is this
a. as simple as using a db
b. a good idea?

Thanks loads!
 
If you're willing to accept a limitation of about 1000 addresses or so (performance limitations), you can use an XML file.

Create an XML record that looks something like this using the .CreateElement and .CreateTextNode methods of the XmlDocument object (do *not* use string concatenation!):
Code:
<Address>
  <FirstName/>
  <LastName/>
  <NickName/>
  <Street1/>
  <Street2/>
  <City/>
  <StateProvince/>
  <PostalCode/>
  <Phones>
    <Phone>
      <Type/>
      <Number/>
    </Phone>
  </Phones>
<Address>
When the program loads, you can read the file in using the .Load method on a XmlDocument object. When the user makes &quot;enough&quot; changes to the address book, write it back out using the .Save method.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Good answer but one question ...
Can I use multipul files i.e. people with a-m in one and n-z in the other? would thins help with the performance?
I assume the answer is yes but I can't test it at the momment (re-installing my system)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top