Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cant See Fields In Typed Dataset
Message
From
26/05/2008 13:35:46
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01319518
Message ID:
01319533
Views:
12
Nope, no suggestions ... that should work. =0)

~~Bonnie



>Thanks Bonnie!
>
>I have a method called LoadProject which takes a reference to the dataset as a param. It is overloaded to take no param, in which case the dataset will be empty for a new record.
>
>So now I have:
>
>
>// Load a new project
>public void LoadProject()
>{
>    // Set the caption label
>    lblPageCaption.Text = "New Project - Untitled";
>}
>
>// Load an existing project
>public void LoadProject(dsProject dsProjectData)
>{
>    // Load the data set here
>
>    // Set the caption label
>    lblCaption.Text = dsProjectData.dtProject[0].Caption;
>}
>
>
>
>I'm open to suggestions on my design, if you have any.
>
>Thanks!
>
>
>
>>So, why do you have it called dtProject when it is a DataSet? And in your example, you *are* calling it dsProject, so perhaps your "dt" was a typo.
>>
>>At any rate, you need to actually have an instance of the DataSet:
>>
>>
>>dsProject oData = new dsProject();
>>// next, you need some code to fill the dataset
>>// otherwise, you will have no rows in your dtProject table
>>lblCaption.Text = oData.dtProject[0].Caption;
>>
>>
>>~~Bonnie
>>
>>
>>
>>>I created a typed dataset in the designer called 'dtProject'. It has 2 columns, 'ProjectKey' and 'Caption'.
>>>
>>>I want to set the value of a label to the data set's Caption value. When I type:
>>>
>>>
>>>lblCaption.Text = dsProject.
>>>
>>>
>>>when Intellisense opens, I see 'dtProjectDataTable' and 'dtProjectRow'. I'm guessing VS created these names on it's own, because I didn't create them.
>>>
>>>From this point, I cannot see any way to reference the Caption column on the data set.
>>>
>>>Someone wanna help a newby?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform