473,322 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Typed DataSet

According to a Microsoft article a typed dataset is available through
intellisense and can be accessed like in this example:

TextBox1.Text = NorthwindDataSet.Customers(3).ContactName

I have created the Typed DataSet after microsoft recomandations and it's
available in the object browser, but this is where my problem begins..
I work in VB obviously, but the objects from the Dataset apears as C#...
strange. I haven't seen any setting for changing this to VB. I guess this is
the reason I can't access the dataset as in the example above.

Can anyone point me in the right direction, please? That would be much
appreciated!

- Jørn
Jan 18 '06 #1
5 1650
"Jørn Jensen" <jo*********@mp3pro.no> schrieb
According to a Microsoft article a typed dataset is available
through intellisense and can be accessed like in this example:

TextBox1.Text = NorthwindDataSet.Customers(3).ContactName

I have created the Typed DataSet after microsoft recomandations and
it's available in the object browser, but this is where my problem
begins.. I work in VB obviously, but the objects from the Dataset
apears as C#...
Where do you see C# code? Do you get compiler errors? If you can access it
as mentioned above, where do you see the problem?
strange. I haven't seen any setting for changing this to VB. I guess
this is the reason I can't access the dataset as in the example
above.


Armin

Jan 18 '06 #2
Browsing the Object Browser, the available methods are presented in a C#
syntax, and the root node has a C# icon.

Intellisense shows:

myDataSet.myTableDataTable, myDataSet.myTableRow,
myDataSet.myTableRowChange etc... But no columns.

When I try to compile I get this message:
"Reference to a non-shared member requires an object reference."

This happens compiling only this line of code (in the page_load event)

Dim strTest As String = dsPmsItem.tablePmsItem(3).Artist

The DataSet I created works perfectly when I do a preview from the
DataSet designer.

(thanks for your reply!)

*** Sent via Developersdex http://www.developersdex.com ***
Jan 18 '06 #3
"Jørn Jensen" <jo*********@mp3pro.no> schrieb
Browsing the Object Browser, the available methods are presented in
a C# syntax, and the root node has a C# icon.

This is strange. Did you add a new C# project to the solution? (Dumb
question, maybe).

Intellisense shows:

myDataSet.myTableDataTable, myDataSet.myTableRow,
myDataSet.myTableRowChange etc... But no columns.

When I try to compile I get this message:
"Reference to a non-shared member requires an object reference."

This happens compiling only this line of code (in the page_load event)

Dim strTest As String = dsPmsItem.tablePmsItem(3).Artist

The DataSet I created works perfectly when I do a preview from the
DataSet designer.

Are you sure you created a dataset object? Is dsPmsItem the name of the
typed dataset class or is it a variable you've declared on your own (or
dropped on the Form using the designer)?
Armin

Jan 18 '06 #4
I didn't add a C# project =)

I added a DataSet called PmsItem.xsd to the App_Code folder. Then I
completed the wizard, created stored procedures and ended up with a
functioning DataSet. The Table name from my SQL database was pretty
silly, so I changed the Name of the DataSet to dsPmsItem and the name of
the (only) table in the DataSet to tablePmsItem.

I changed the names in the properties window in the DataSet designer and
did a successful "Preview Data..." after.

I tried something new now:

I declared new dataset:

Dim dsPmsItem As New dsPmsItem

And used the same statement on page_load as before:

Dim strTest As String = dsPmsItem.tablePmsItem(0).Artist
lblLabel1.Text = strTest

This worked, but it didn't return anything. And I got an error saying
that that the index number must not exceed the number of rows, or the
column name doesn't not excist, or etc..

The dataset apears to be empty... Obviously, since I created it as New.
How do I fill it?

*** Sent via Developersdex http://www.developersdex.com ***
Jan 18 '06 #5
"Jørn Jensen" <jo*********@mp3pro.no> schrieb
I didn't add a C# project =)

I added a DataSet called PmsItem.xsd to the App_Code folder.
I'm afraid, I don't know this folder because I'm creating Winforms
applications only.

Then I
completed the wizard, created stored procedures and ended up with a
functioning DataSet. The Table name from my SQL database was pretty
silly, so I changed the Name of the DataSet to dsPmsItem and the
name of the (only) table in the DataSet to tablePmsItem.

I changed the names in the properties window in the DataSet designer
and did a successful "Preview Data..." after.

I tried something new now:

I declared new dataset:

Dim dsPmsItem As New dsPmsItem

And used the same statement on page_load as before:

Dim strTest As String = dsPmsItem.tablePmsItem(0).Artist
lblLabel1.Text = strTest

This worked, but it didn't return anything. And I got an error
saying that that the index number must not exceed the number of
rows, or the column name doesn't not excist, or etc..

The dataset apears to be empty... Obviously, since I created it as
New. How do I fill it?

Use a DataAdapter or an OleDBDataReader/SqlDataReader.

More about ADO.Net:
http://msdn.microsoft.com/library/en...withadonet.asp

"Creating and Using DataSets":
http://msdn.microsoft.com/library/en...ngdatasets.asp

"Using a DataSet with Existing Data":
http://msdn.microsoft.com/library/en...istingdata.asp

"Populating a DataSet from a DataAdapter":
http://msdn.microsoft.com/library/en...ataadapter.asp
Armin

Jan 18 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Freeon | last post by:
Hi, I am looking for a way to sort a strong typed dataset. It would seem the most straightforward way is to use a dataview. The only problem is when I use the dataview I seem to loose the strong...
3
by: Freeon | last post by:
Hi, I am looking for a way to sort a strong typed dataset. It would seem the most straightforward way is to use a dataview. The only problem is when I use the dataview I seem to loose the strong...
1
by: Optimus | last post by:
Hi everyone, I currently develop an application in vs.net 2005 with vb.net. I was trying to use typed dataset and I've got in trouble for converting untyped dataset into Typed DataSet. I don't...
21
by: Peter Bradley | last post by:
Hi all, This post is sort of tangentially related to my earlier posts on configuration files for DLLs. Does anyone know how to create typed DataSets using VS2005's new DataSet designer, but...
4
by: Rachana | last post by:
Hi, I have understood Data Sets but what is meant by typed/untyped/ strongly typed datasets. Can any one explain me or suggest any site/ article, to get these concepts (and their ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.