0
votes

I created a strongly typed dataset (Project -> Add new item -> dataset). I assigned a stored procedure to it and created the dataset. Under Datasources i can find my dataset (ds_1) when i click on the littel arrow a datatabel drops out (dt_1). If i doubleclick in the solution explorer on ds_1.xsd i can see the table and the table adapter and a click on preview give me the right table as well. Now I want assign my datatable to a table varialbe

dim MyTable as new Datatable
MyTable = applicationname.ds_1.

intelisense offers me

.dt_1DataTable

but when i drop that line i get an error (dt_1DataTable is a type of applicationname.ds_1 and cannot used as an expression).

Could anyone tell me why I get this error and how I can assign the table?

1

1 Answers

0
votes

You need to create an instance of the dataset first. This will then include instances of the tables, which will then appear in Intellisense along with the classes, which is what you are seeing now. Also in your code you are dim'ing MyTable to a weekly-typed table. Instead, you should be doing something like this:

dim ds as new ds_1
dim dt as new ds_1.dt_1datatable