473,569 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Typed DataSet

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

TextBox1.Text = NorthwindDataSe t.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 1672
"Jørn Jensen" <jo*********@mp 3pro.no> schrieb
According to a Microsoft article a typed dataset is available
through intellisense and can be accessed like in this example:

TextBox1.Text = NorthwindDataSe t.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.myTab leDataTable, myDataSet.myTab leRow,
myDataSet.myTab leRowChange 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.table PmsItem(3).Arti st

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*********@mp 3pro.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.myTab leDataTable, myDataSet.myTab leRow,
myDataSet.myTab leRowChange 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.table PmsItem(3).Arti st

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.table PmsItem(0).Arti st
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*********@mp 3pro.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.table PmsItem(0).Arti st
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
325
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 typed properties from my original dataset Anyone that can point me to an example of how to sort my dataset and maintain the use of my typed...
3
2741
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 typed properties from my original dataset Anyone that can point me to an example of how to sort my dataset and maintain the use of my typed...
1
9343
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 know why I cannot perform this casting operation properly. First off, I've got my Typed DataSet named "AuthInfo" declared and I then created an...
21
2398
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 with the ability to configure the connection string via a config file? The designer seems to hard-code the connection string into the dataset...
4
3098
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 comparisions) cleared? Thanks, Rachana
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.