I always seem to use Get when working with data (strongly typed or otherwise) from the database and I have never really needed to use Fill although I just as easily could use Fill instead of get when pulling out and updating data.
Can anyone provide guidance as to the implications and gotchas of each method?
In what situations is it preferable to use one or the other?
Any performance implications?
Thanks in advance for the answers! I love this community!
The Fill method of the DataAdapter is used to populate a DataSet with the results of the SelectCommand of the DataAdapter . Fill takes as its arguments a DataSet to be populated, and a DataTable object, or the name of the DataTable to be filled with the rows returned from the SelectCommand .
TableAdapters are designer-generated components that connect to a database, run queries or stored procedures, and fill their DataTable with the returned data. TableAdapters also send updated data from your application back to the database.
The Fill method retrieves rows from the data source using the SELECT statement specified by an associated SelectCommand property.
Using Fill can be great for debugging exceptions because the DataTable passed into the method can be interrogated for more details. Get does not return in the same situation.
Tips:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With