da.Fill(second datatable)
-
Hi! Just a basic question but I don't know the answer =) Please help So I have a stored procedure with 2 select query SELECT A,B FROM table1 SEleCT C,D FROM table2 In my typed dataset, how do I retrieve values in table2 using da.Fill() or should I be using another code for this? da.Fill(dt); when I can't use somethign like da.Fill(dt2); Thank you very much.
Gerri
-
Hi! Just a basic question but I don't know the answer =) Please help So I have a stored procedure with 2 select query SELECT A,B FROM table1 SEleCT C,D FROM table2 In my typed dataset, how do I retrieve values in table2 using da.Fill() or should I be using another code for this? da.Fill(dt); when I can't use somethign like da.Fill(dt2); Thank you very much.
Gerri
you need to fill a dataset with the output from the stored procedure so: dim ds as dataset da.fill(ds) then the dataset will have 2 tables in it (normally) and you can select the 2 tables by there index dim dt1 as datatable = ds.tables(0) dim dt2 as datatable = ds.tables(1) sorry for the vb.net code but should be easly translated hope this helps
If my help was helpfull let me know, if not let me know why. The only way we learn is by making mistakes.
-
you need to fill a dataset with the output from the stored procedure so: dim ds as dataset da.fill(ds) then the dataset will have 2 tables in it (normally) and you can select the 2 tables by there index dim dt1 as datatable = ds.tables(0) dim dt2 as datatable = ds.tables(1) sorry for the vb.net code but should be easly translated hope this helps
If my help was helpfull let me know, if not let me know why. The only way we learn is by making mistakes.
Thank you. I would just like to ask. I have a Report.xsd file and uses this: DataAccess.dsReportManagementTableAdapters.rpt_RetrieveTableAdapter da = new DataAccess.dsReportManagementTableAdapters.rpt_RetrieveTableAdapter(); DataAccess.dsReportManagement.rpt_RetrieveDataTable dt = new DataAccess.dsReportManagement.rpt_RetrieveDataTable(); da.Fill(dt); How come my Fill() doesn't take a DataSet as a parameter? Thank you.
Gerri
-
Thank you. I would just like to ask. I have a Report.xsd file and uses this: DataAccess.dsReportManagementTableAdapters.rpt_RetrieveTableAdapter da = new DataAccess.dsReportManagementTableAdapters.rpt_RetrieveTableAdapter(); DataAccess.dsReportManagement.rpt_RetrieveDataTable dt = new DataAccess.dsReportManagement.rpt_RetrieveDataTable(); da.Fill(dt); How come my Fill() doesn't take a DataSet as a parameter? Thank you.
Gerri
because you don't use a dataadapter but a tableadapter from the looks of it you are trying to extract data from a xml file (on a side note xml isn't the ideal way for datastorage) I have never tryed this before but look of you cant find a xmldataadapter (or somthing like that) normally that should accept a dataset as parameter
If my help was helpfull let me know, if not let me know why. The only way we learn is by making mistakes.