Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DataSets (C#)

Reply
Thread Tools

DataSets (C#)

 
 
=?Utf-8?B?Qw==?=
Guest
Posts: n/a
 
      03-05-2005
Hi,

I am using DataSets to populate some controls on my ASPX.

I retrieve some values using the Index in my DataSets.

For example dsTest.Tables[0].Rows[0].ItemArray[0] etc etc

How can I retrieve the value using the Column name /alias used in my SQL
rather than my Index.

Thanks,
Clive.
 
Reply With Quote
 
 
 
 
Peter Rilling
Guest
Posts: n/a
 
      03-05-2005
Just replace the index with the column name (i.e. ...Rows["SomeCol"]...).

"C" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I am using DataSets to populate some controls on my ASPX.
>
> I retrieve some values using the Index in my DataSets.
>
> For example dsTest.Tables[0].Rows[0].ItemArray[0] etc etc
>
> How can I retrieve the value using the Column name /alias used in my SQL
> rather than my Index.
>
> Thanks,
> Clive.



 
Reply With Quote
 
 
 
 
Mark Fitzpatrick
Guest
Posts: n/a
 
      03-05-2005
Use:
dsTest.Tables[0].Rows[0]["columnname"]
or
dsTest.Tables[0].Rows[0].Item["columnname"]

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"C" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I am using DataSets to populate some controls on my ASPX.
>
> I retrieve some values using the Index in my DataSets.
>
> For example dsTest.Tables[0].Rows[0].ItemArray[0] etc etc
>
> How can I retrieve the value using the Column name /alias used in my SQL
> rather than my Index.
>
> Thanks,
> Clive.



 
Reply With Quote
 
Karl Seguin
Guest
Posts: n/a
 
      03-05-2005
dsTest.Tables[0].Rows[0]["FirstName"]

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)


"C" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I am using DataSets to populate some controls on my ASPX.
>
> I retrieve some values using the Index in my DataSets.
>
> For example dsTest.Tables[0].Rows[0].ItemArray[0] etc etc
>
> How can I retrieve the value using the Column name /alias used in my SQL
> rather than my Index.
>
> Thanks,
> Clive.



 
Reply With Quote
 
Peter Rilling
Guest
Posts: n/a
 
      03-05-2005
Actaully, it should be something like ...Rows[0]["SomeCol"]...

"Peter Rilling" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Just replace the index with the column name (i.e. ...Rows["SomeCol"]...).
>
> "C" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi,
>>
>> I am using DataSets to populate some controls on my ASPX.
>>
>> I retrieve some values using the Index in my DataSets.
>>
>> For example dsTest.Tables[0].Rows[0].ItemArray[0] etc etc
>>
>> How can I retrieve the value using the Column name /alias used in my SQL
>> rather than my Index.
>>
>> Thanks,
>> Clive.

>
>



 
Reply With Quote
 
Karl Seguin
Guest
Posts: n/a
 
      03-05-2005
You still need the row index in there

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)


"Peter Rilling" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Just replace the index with the column name (i.e. ...Rows["SomeCol"]...).
>
> "C" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi,
> >
> > I am using DataSets to populate some controls on my ASPX.
> >
> > I retrieve some values using the Index in my DataSets.
> >
> > For example dsTest.Tables[0].Rows[0].ItemArray[0] etc etc
> >
> > How can I retrieve the value using the Column name /alias used in my SQL
> > rather than my Index.
> >
> > Thanks,
> > Clive.

>
>



 
Reply With Quote
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      03-06-2005
dsTest.Tables[0].Rows[0]["ColumnName"]

--
Gregory A. Beamer
MVP; MCP: +I, SD, SE, DBA

*************************************************
Think outside the box!
*************************************************
"C" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I am using DataSets to populate some controls on my ASPX.
>
> I retrieve some values using the Index in my DataSets.
>
> For example etc etc
>
> How can I retrieve the value using the Column name /alias used in my SQL
> rather than my Index.
>
> Thanks,
> Clive.



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class? Francisco Garcia ASP .Net Web Services 3 04-13-2006 05:53 PM
How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class? Francisco Garcia ASP .Net 2 04-13-2006 10:41 AM
How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class? news.microsoft.com ASP .Net Web Services 0 04-12-2006 09:07 AM
How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class? news.microsoft.com ASP .Net 0 04-12-2006 09:07 AM
pass an undefined number of datasets Andreas VHDL 5 05-31-2005 06:06 PM



Advertisments