Results 1 to 5 of 5

Thread: [RESOLVED] VB.NET Strings and Lots of them ???

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    6

    Resolved [RESOLVED] VB.NET Strings and Lots of them ???

    I am currently building this application that will require an interactive form where the user can select to view a certain part of the string or by default the whole amount of string.
    My question is what would be the best way to import this string to the form as far as speed, filtering, and hashing is concerned.
    I do not want users to change the data, just viewing only.
    Should I use XML, bin files that hold the string, or a database?
    Thanks
    I know who to do all of these, just not sure which would be best. Another persons view would be great thanks in advanced!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: VB.NET Strings and Lots of them ???

    If the string is not too long then you should probably store it in the config file as an application setting, accessible via My.Settings. If the string is very long then a simple text file would be the easiest way.

    This is assuming that you just have a single string because you really haven't provided too much of an explanation.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    6

    Re: VB.NET Strings and Lots of them ???

    thanks for the feed back. Strings will be very long setup like a book. So user needs to go to chapter 2. Then form will need to show everything starting at chapter 2. so my.settings would not be the best place for that. I'm thinking db.
    If I use txt files would I place everything in the text file
    right now data looks like this:
    chapter 1
    text goes here
    chapter 2
    text goes here

    Hope this clears everything up

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: VB.NET Strings and Lots of them ???

    You could use a separate file for each chapter. You could use a database, although for something as simple as just getting a single chapter at a time it doesn't really seem worth it. You'd have one table with a chapter number as PK and another column with the text and every query would be get a single chapter's text by chapter number. A database seems overkill, although it certainly would work.

    You might also store the data as resources if it's not going to change. That would protect it a little more than loose text files. You could store them in your EXE or in a satellite DLL.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    6

    Re: VB.NET Strings and Lots of them ???

    Thanks for the help. I may store the data as resources.
    I did not think about that but that would really work.
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width