Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: transversing a RecordSet


Message #1 by "DJ KNO3" <djkno3@m...> on Tue, 25 Mar 2003 12:43:48 +0100
I am converting a vb app into a c# app (for asp .net) I'm having trouble 
transversing a RecordSet.  the vb syntax is
DataSet.Tables(0).Rows(0)
when I put this into C# it chokes after Tables seeing as this is a property 
and I can't go any further in it.  I am using .net 1.1. Is there anyway to 
transverse the RecordSet like this in C#? Or can you point me somewhere 
where I could find out. If it's msdn please be nice enough to give me the 
actual page or I will spend about 2hours being lost in all the info :D

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail

Message #2 by "Jerry Lanphear" <jerrylan@q...> on Tue, 25 Mar 2003 08:16:42 -0700
DJ,
Unfortunately your message is a bit incomplete to point you to a complete
solution.  "RecordSets" do not exist in ADO.NET. If you wish to transverse a
DataSet Table using the below code you will need to use the DataSet actual
name.  Be aware of what each statement will return.  You may need to use
something like myRow = myDataSet.Tables(0).Rows(0) to return an entire row
in myRow.

Regards
----- Original Message -----
From: "DJ KNO3" <djkno3@m...>
To: "aspx_beginners" <aspx_beginners@p...>
Sent: Tuesday, March 25, 2003 4:43 AM
Subject: [aspx_beginners] transversing a RecordSet


> I am converting a vb app into a c# app (for asp .net) I'm having trouble
> transversing a RecordSet.  the vb syntax is
> DataSet.Tables(0).Rows(0)
> when I put this into C# it chokes after Tables seeing as this is a
property
> and I can't go any further in it.  I am using .net 1.1. Is there anyway to
> transverse the RecordSet like this in C#? Or can you point me somewhere
> where I could find out. If it's msdn please be nice enough to give me the
> actual page or I will spend about 2hours being lost in all the info :D
>
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
>
>

Message #3 by "DJ KNO3" <djkno3@m...> on Tue, 25 Mar 2003 21:38:53 +0100
>DJ,
>Unfortunately your message is a bit incomplete to point you to a complete
>solution.  "RecordSets" do not exist in ADO.NET. If you wish to transverse 
>a
>DataSet Table using the below code you will need to use the DataSet actual
>name.  Be aware of what each statement will return.  You may need to use
>something like myRow = myDataSet.Tables(0).Rows(0) to return an entire row
>in myRow.
>
>Regards


It is actually a DataSet but when I compile it with C# (try to that is) it 
throws a "'System.Data.DataSet.Tables' denotes a 'property' where a 'method' 
was expected" error. My C# code is:

DataSet myData;
if (myData.Tables(0).Rows.Count <= 0)   <- error line.
......


_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus

Message #4 by "Will Swim" <wswim@p...> on Tue, 25 Mar 2003 15:05:55 -0800
try 
if (mydata.mytable.rows.count <= 0)


> It is actually a DataSet but when I compile it with C# 
> (try to that is) it 
> throws a "'System.Data.DataSet.Tables' denotes a 
> 'property' where a 'method' 
> was expected" error. My C# code is:
> 
> DataSet myData;
> if (myData.Tables(0).Rows.Count <= 0)   <- error line.
> ......
> 

Message #5 by "DJ KNO3" <djkno3@m...> on Wed, 26 Mar 2003 07:45:42 +0100
nope no luck BUT I did figure it out :D I forgot that vb uses () when 
denoting an index but C# uses [] thanks for trying to help though guys :D

>try
>if (mydata.mytable.rows.count <= 0)
>
>
> > It is actually a DataSet but when I compile it with C#
> > (try to that is) it
> > throws a "'System.Data.DataSet.Tables' denotes a
> > 'property' where a 'method'
> > was expected" error. My C# code is:
> >
> > DataSet myData;
> > if (myData.Tables(0).Rows.Count <= 0)   <- error line.
> > ......
> >
>
>


_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail


  Return to Index