473,385 Members | 1,888 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,385 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 1658
"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.