开发者

DataAdapter.Fill to specific table in dataset

I am trying to make use of DataAdapter, unfortunately stuck with straight ADO.Net, and开发者_开发技巧 all of the examples I see have a call like this:

dataAdapter.Fill(dataSet, "TableName");

I want to do a fill in that manner, meaning the data goes into a named table, so that I can properly manage the tables later on in the cycle.

Unfortunately, it appears that that method signature no longer exists, and I am struggling a bit to figure out how to name the table in the DataSet properly. Is there a preferred method for doing this now? Or did MS just scrap this method of interacting with your DataSet?


How about something like this ?

    DataTable myTable = new DataTable("MyTable");
    adapter.Fill(myTable);
    ds.Tables.Add(myTable);

One more thing, the method signature you mentioned does exist. You can find the method reference here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜