|
-
Mar 20th, 2015, 10:31 PM
#1
Thread Starter
Addicted Member
What's the difference between datasource, datatable, dataset etc...?
Hello, I want to know what's the difference between datasource, datatable, dataset, dataadapter, datatableadapter, databindingsource and if there's any other objects for databases. Which ones should I use?
And...
I have an mdb database and I've been searching for hours for saving specific cell value after it's modified in a datagridview. The cell type is boolean. When I test the program and click on the checkbox and close the program and test it again, I see that the value isn't saved.
Last edited by nikel; Mar 20th, 2015 at 11:21 PM.
-
Mar 21st, 2015, 01:13 AM
#2
Re: What's the difference between datasource, datatable, dataset etc...?
With ADO.NET, you generally make a connection to your database and retrieve data to create a local copy. You then make changes to that local copy completely independently to the database itself. Finally, you save all the changes from the copy back to the database.
So, you use an adapter to connect to the database and retrieve the data into a DataTable that may or may not be in a DataSet. You then bind the DataTable to a BindingSource and that to a DataGridView. As you make changes to the grid, those changes are automatically propagated to the DataTable, which is the whole point of data-binding. When you're done, call EndEdit on the BindingSource to ensure that any pending edit is committed and then use the same adapter to save the changes from the DataTable back to the database.
You can use an untyped DataSet or DataTable and a data adapter or you can use a typed DataSet and a table adapter. The first option gives you more fine-grained control while the second option is easier and less error-prone for most common operations.
If you want to go with the first option then you might follow the Database FAQ link in my signature below and check out the .NET resources there. If you prefer the second option, follow the Data Walkthroughs link instead. With regards to your first question, you might like to check out this link:
http://www.vbforums.com/showthread.p...ion&highlight=
-
Mar 21st, 2015, 10:44 AM
#3
Thread Starter
Addicted Member
Re: What's the difference between datasource, datatable, dataset etc...?
Oh, I was feeling stupid when I asked this, because I thought there was something simple I should have known. My first guess was, they seperate from one another because of the version changes. Thanks for the detailed explanation.
-
Mar 21st, 2015, 11:46 AM
#4
Re: What's the difference between datasource, datatable, dataset etc...?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 22nd, 2015, 03:24 AM
#5
Thread Starter
Addicted Member
Re: What's the difference between datasource, datatable, dataset etc...?
 Originally Posted by .paul.
That's very useful for me. Thanks a lot.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|