PC Review


Reply
Thread Tools Rate Thread

Column names typed dataset

 
 
=?Utf-8?B?bW9ndWxz?=
Guest
Posts: n/a
 
      12th Jan 2005
Is there a way to get the column names in a strongly typed dataset. If I
have a dataset and want to set RowError to the name of the column without
hardcoding it. I want a compile time error if the name of the column does not
exist in the dataset.

If I have a column named emailaddress in Dataset adressDataset I want to do
something like this

adressRow.RowError = adressDataset.adressTable.emailaddress.columnname

 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      12th Jan 2005
Hi,

Try with:
adressRow.RowError = adressDataset.adressTable.emailaddressColumn.columnname

where addressDataset is an instance of your strong typed dataset.
However, this won't work if your dataset is defined in another assembly...

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com


"moguls" <(E-Mail Removed)> wrote in message
news:EBC153F2-735B-4FCD-89D3-(E-Mail Removed)...
> Is there a way to get the column names in a strongly typed dataset. If I
> have a dataset and want to set RowError to the name of the column without
> hardcoding it. I want a compile time error if the name of the column does
> not
> exist in the dataset.
>
> If I have a column named emailaddress in Dataset adressDataset I want to
> do
> something like this
>
> adressRow.RowError = adressDataset.adressTable.emailaddress.columnname
>



 
Reply With Quote
 
=?Utf-8?B?bW9ndWxz?=
Guest
Posts: n/a
 
      12th Jan 2005
Thanks for a quick reply!
The problem is that the dataset is defined in another assembly. Is there a
way to solve this? Does it work in version 2.0 of .Net framework?


"Miha Markic [MVP C#]" wrote:

> Hi,
>
> Try with:
> adressRow.RowError = adressDataset.adressTable.emailaddressColumn.columnname
>
> where addressDataset is an instance of your strong typed dataset.
> However, this won't work if your dataset is defined in another assembly...
>
> --
> Miha Markic [MVP C#] - RightHand .NET consulting & development
> SLODUG - Slovene Developer Users Group
> www.rthand.com
>
>
> "moguls" <(E-Mail Removed)> wrote in message
> news:EBC153F2-735B-4FCD-89D3-(E-Mail Removed)...
> > Is there a way to get the column names in a strongly typed dataset. If I
> > have a dataset and want to set RowError to the name of the column without
> > hardcoding it. I want a compile time error if the name of the column does
> > not
> > exist in the dataset.
> >
> > If I have a column named emailaddress in Dataset adressDataset I want to
> > do
> > something like this
> >
> > adressRow.RowError = adressDataset.adressTable.emailaddress.columnname
> >

>
>
>

 
Reply With Quote
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      12th Jan 2005

"moguls" <(E-Mail Removed)> wrote in message
news:B34FD7C3-58CA-4434-978D-(E-Mail Removed)...
> Thanks for a quick reply!
> The problem is that the dataset is defined in another assembly. Is there a
> way to solve this?


Not that I know of.

Does it work in version 2.0 of .Net framework?

Yes, it should.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Typed Dataset Column Assignment Miro Microsoft VB .NET 1 12th Sep 2008 12:42 AM
column names in a strongly typed dataset =?Utf-8?B?U2VyZ2V5IFp1eWV2?= Microsoft ADO .NET 0 21st Feb 2006 04:20 PM
column names in a strongly typed dataset =?Utf-8?B?U2VyZ2V5IFp1eWV2?= Microsoft ADO .NET 0 17th Feb 2006 05:10 PM
Column names and typed dataset =?Utf-8?B?QW5IdW5k?= Microsoft ADO .NET 3 22nd Nov 2005 04:27 PM
Typed DataSet names - length restriction Eva Lidji Microsoft ADO .NET 0 11th May 2004 03:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:42 AM.