Wednesday, May 1, 2013

Can DataAdapter object accept DataTable as parameter in Fill method?


Yes,

DataAdapter object can accept either DataTable or DataSet as parameter to fill data from database.

eg.

SqlDataAdapter dAd = new SqlDataAdapter();

DataTable dTable = new DataTable();

DataSet dSet = new DataSet();

----

---

dAd.Fill(dTable); // will also work

dAd.Fill(dSet); // will also work

No comments:

Post a Comment