By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,885 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

what am I doing wrong?

P: n/a
Hi all,

I am attempting to return the number of returned rows in a table
within a dataset and display that on a label on my page. I figured
this would be a fairly easy process, but alas it seems I am missing
something.
This is in my Sub Page_Load after my db connection and dataset
creation, etc...:

mylabel.Text = ds.Tables(0).Rows.Count
My label in my html is this:

<asp:label ID ="mylabel" runat="server"/>

What am I missing?

cheers, Joe

Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You don't tell us what language you're working with, no specific error
messages you're getting, and not much else to go on - so a couple of shots
in the dark...

If you are coding with C#, then you'd need the following:
mylabel.Text = DS2.Tables[0].Rows.Count;
or
mylabel.Text = DS2.Tables[0].Rows.Count.ToString();

does your html include a <form> tag with runat="server"?

"Joe777" <jv******@eastlink-dot-ca.no-spam.invalid> wrote in message
news:40********@127.0.0.1...
Hi all,

I am attempting to return the number of returned rows in a table
within a dataset and display that on a label on my page. I figured
this would be a fairly easy process, but alas it seems I am missing
something.
This is in my Sub Page_Load after my db connection and dataset
creation, etc...:

mylabel.Text = ds.Tables(0).Rows.Count
My label in my html is this:

<asp:label ID ="mylabel" runat="server"/>

What am I missing?

cheers, Joe

Nov 18 '05 #2

P: n/a
Yes it does include <form runat="server">

The error I am getting is not declared error on the label name.

"Wang" <sy*********@nospam.com> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
You don't tell us what language you're working with, no specific error
messages you're getting, and not much else to go on - so a couple of shots
in the dark...

If you are coding with C#, then you'd need the following:
mylabel.Text = DS2.Tables[0].Rows.Count;
or
mylabel.Text = DS2.Tables[0].Rows.Count.ToString();

does your html include a <form> tag with runat="server"?

"Joe777" <jv******@eastlink-dot-ca.no-spam.invalid> wrote in message
news:40********@127.0.0.1...
Hi all,

I am attempting to return the number of returned rows in a table
within a dataset and display that on a label on my page. I figured
this would be a fairly easy process, but alas it seems I am missing
something.
This is in my Sub Page_Load after my db connection and dataset
creation, etc...:

mylabel.Text = ds.Tables(0).Rows.Count
My label in my html is this:

<asp:label ID ="mylabel" runat="server"/>

What am I missing?

cheers, Joe


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.