Well.. Yes... you can... but coming from a flat file your going to struggle
a little.
In order for databinding to work within windows forms (particularly a grid)
a bindable class must implement ITypedList and IBindingList (for datagrid).
The minimum to do any binding is IList.
So.. the best approach for you is to build a class and derive IList for
starters just to get a feel of how it works (I think IList only has like 3
or 4 members you have to implement) and you can then bind that class. Now
this class will read in your sequential file and expose it to .NET in a
manner they both agree on (the IList Interface), and thats about it.
So.. your class reads in the file and implements IList... so you may have
something.
Public MyReadingClass Implements IList
...implementation and such
End Class
Public class myForm
inherits System.Windows.Forms.Form
public sub form_load(sender as object, e as system.eventargs) handles
mybase.load
dim myReader as new MyReadingClass
myDataGrid.DataSource = myReader
End Sub
End Class
This will give you a basic "list" (no column names, not multiple columns as
far as I know, just a list) but its a starting point for learning interfaces
and understanding IBindingList, and ITypedList.
Thats when it gets really fun (I'm serious, writing custom data binding
classes is fun!)
HTH,
CJ
"Tom McLaughlin" <tb***@cwnet.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I am new to vb.net and I am running into problems understanding
DataBinding and its concept. The only examples I find are always
talk about Web design, I only want to use this data on my
standalone computer. So my question is:
I have a sequential file that contains data and the data is structured.
is there a way to load this data into a DataGrid control?
If the answer is yes, then how do I accomplish this?
I am using vb.net the STANDARD version 2003.
Thanks
Tom