I would have to disagree with the majority of the above reply. You should not be retrieving un-needed data from a database and holding it in memory. Write your query to get only the records that you need for this single user.
' You do not need to retrieve and store all users in your db.
' Likewise you don't need to retrieve all mail records.
' You have the login username, you only need a
' single table to query the records belonging to this user.
in my opinion what you should do id have two tables in your database one is "username" second is transaction.
Get the relation done between the 2 tables so that username is the primary key flield which is related to username in transaction table,many to one relationship.
' Again this is un-needed but just wanted to point out that
' you do not need seperate DataAdapters for every DataTable in
' a DataSet.
' Also I would suggest writing all your queries as stored procedures
' in whatever database you are using. It is more efficient, flexible
' and provides reusability for other datasets having the
' same queries within your app or other apps using the same db.
Now starting from vb.net editor code, you should add a tool
oledbconnection and 2 dataadapters because you have 2 tables. The wizard will open for the sql statement one for each dataadapter, set the tables by selecting then, through sqlqueries.
Then generate a dataset that englobes the 2 tables.
After that click twice on the .xsd file and sort the schema by
adding a new relation ship ((username via transaction id)).
Use the fill method to fill the data set.
Write the necessary statements to save back to the database:
' Explicitly calling a Dataset/DataTable's AcceptChanges method
' seems to be a very common mistake by many programmers.
' In truth this is rarely needed. Your DataAdapter will automatically
' adjust the row state changes after any action command has
' been executed.
Like getchanges and update dataadapter and accept changes.
Youare set up.
Make a button to trigger the code like name it get data.
' You can not show multiple tables in a single
' DataGridView control in .Net.
You will see that in the datagrid shows the username and besides it there is a plus sign, click it and you would have the transactions for that username.