Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Incorrectly Calling TableAdapter.Fill() Statement?

$
0
0
This is probably going to be a massive *facepalm* moment later on, but hopefully someone can assist me.

In this project of mine I have a DataSet called dsSample which has a SampleTableAdapater that is linked to my Sample table in my SQL Server 2008 Database. In my SampleTableAdapter, I created a Fill() statement called .FillByBottleNumRange(). The Query Syntax is below:

SELECT        Sample.BottleNumber, Sample.LabSampleNumber, Oil.Viscosity
FROM            Sample INNER JOIN
                         Oil ON Sample.OilID = Oil.OilID
WHERE        (Sample.BottleNumber BETWEEN @Value1 AND @Value2)



Now in my code I have the following:

SampleTableAdapter tblAdapterSample = new SampleTableAdapter();
dsSample.SampleDataTable dt;
tblAdapterSample.FillByBottleNumRange(dsSample.SampleDataTable, _beg_cont_num, _end_cont_num);



This is the sections that continues to give me an error:

(dsSample.SampleDataTable,


When hovering over the error segment it reads:

class wm_MOSS_Chemist.dsSample
Represents the strongly named DataTable class.

Error:
'wm_MOSS_Chemist.dsSample.SampleDataTable' is a 'type', which is not valid in the given context.



Can anyone spot what I'm doing wrong and explain it to me? This is my first foray into C#.

Thanks,
-A.L.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>