Storing Data

So I am new to VB.Net...learned VB from VBA for Excel.  I have a big book of how to's but I am hoping I can get a simple answer.  

Is the only way to create large lists of information (i.e database or spreadsheet)....by creating an sql database?  I want my list to be stored within the program itself...a stand alone file not tied to any server database.  So how do I store my information to pull from like in Excel or Access?  Is there not a grid tool VB.net?  Sorry for the simple question...starting from scratch here.  Thanks to everyone in advance for your patience.

Troy
troyhalseyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

marchianoCommented:
Excel file itself can be a database to store information.
VB.Net is capable to open an excel file, read information and then show it to the user.
someone has posted a question on how to read and open excel file, .e.g
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_20972338.html

if you want to access, it will be better.
but you will need to migrate all of your data from excel to access
0
troyhalseyAuthor Commented:
What if I don't want to reference another program? Is there no way to store data within the application itself?  My concern is this application I am creating will be used on and off of a network.  So I don't want to have the application tied to any other outside source.  
0
DeadlyTrevCommented:
You should investigate Serialisation (serialization).

You can create a class for your data and use serialisation to save it to a file as binary or XML.  Have a look at this little example ... it is a class that can save/load all its property values in a binary data file.

'-----------------------------------------------------------------------------------------
Imports System.Runtime.Serialization.Formatters.Binary
Imports System.io

<Serializable()> Public Class DataStorage

    Public DataItem as Integer
    Public DataItem2 as String
    Public DataItem3(5) as Boolean

    Public Sub Load(ByVal filepathname as string, ByRef ds as DataStorage)
        Dim formatter As New BinaryFormatter
        Dim fs As FileStream
        Try
            fs = New FileStream(filepathname, FileMode.Open)
            ds = CType(formatter.Deserialize(fs), DataStorage)
            fs.Close()
        Catch ex As Exception
            MsgBox("Unable to load from file [" & filepathname & "]" & vbcrlf & ex.message)
        End Try
    End Sub

    Public Sub Save(ByVal filepathname as string)
        Dim formatter as New BinaryFormatter
        Dim fs as FileStream
        Try
            fs = New FileStream(filepathname, FileMode.Create)
            formatter.Serialize(fs, Me)
            fs.Close()
        Catch ex as Exception
            MsgBox("Unable to save to file [" & filepathname & "]" & vbcrlf & ex.message)
        End Try
    End Function
End Class
'-----------------------------------------------------------------------------------------

To use something like this .....

Dim ds as New DataStorage
ds.DataItem = 42
ds.DataItem2 = "Hello World
ds.DataItem3(2) = True
ds.DataItem3(4) = True
ds.Save("C:\DataStorage.dat")
ds = nothing

Dim msg as string
Dim i as integer
ds = new DataStorage
ds.Load(ds)
msg = ds.DataItem & vbcrlf & ds.DataItem2 & vbcrlf
For i=1 to 5
    msg += DataItem3(i) + " "
Next
MsgBox(msg)
0
jrschererCEOCommented:
A well structured way to save and retrieve data is using a DataSet and store and retrieve it in a local XML file.
You can store it in your application directory, in any My Documents directory or in mostly any place you like on your computer.

http://www.codeguru.com/vb/gen/vb_database/adonet/article.php/c5153/

Jack.net
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
troyhalseyAuthor Commented:
Jack-

So if I use a DataSet...when I package the application.  It would all go with the application...no loose ends?

Troy
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.