I know there is probably an obvious reason but I can't find it..
I usually use the using statement during DB connection and data reading, but I can't use it on DataAdapter because it doesn't implement IDisposable.
Also: how can it behave after filling a dataset?
Does it close itself the connection?
Only close it or dispose it?
Do I have to dispose the internal connection by myself after the dataset filling? If so, why IDataAdapter doesn't have a related property/method?
A DataAdapter instance does not hold references to unmanaged code. It simply acts as a "bridge" between the commands and the datasets.
The DataAdapter serves as a bridge between a DataSet and a data source for retrieving and saving data. The DataAdapter provides this bridge by mapping Fill, which changes the data in the DataSet to match the data in the data source, and Update, which changes the data in the data source to match the data in the DataSet.
Source: http://msdn.microsoft.com/en-us/library/system.data.common.dataadapter.aspx
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