> What I want to do is simply assign that value to Label1.Text but lack of
> familiarity with ASP.NET has stopped me cold. I expected to be able to say
> something like:
>
> Label1.Text = SqlDataSource1("RcdCnt")
Hi,
try this way
using (SqlConnection conn = new
SqlConnection(connectionString))
{
conn.Open();
string query = "select COUNT(*) from TABLE_NAME";
SqlDataAdapter da = new SqlDataAdapter(query, conn);
DataTable dt = new DataTable();
da.Fill(dt);
Label1.Text = dt.Rows[0].ToString();
}
I hope that will helps You.
BTW, check this site: http://asp.net/learn/
For me, it is great site for the peoples who starts learning asp.net.
Howdy,
Many ways of doing the task at hand, one possible:
string connectionString = "server=serv;database=db;uid=userId;pwd=passw";
int count = 0;
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlCommand command = new SqlCommand(
"SELECT Count(*) As RcdCnt FROM whatever", connection);
count = (int) command.ExecuteScalar();
}
label1.Text = count.ToString();
Hope it helps

Signature
Milosz
> I am an absolute beginner and finding myself confused at every step that I
> take in the learning process. It will get better.
[quoted text clipped - 20 lines]
> I know that there are all levels of knowledge and experience on this news
> feed and sincerly hope that a rank beginner's question like this is welcome.
James R. Davis - 02 Dec 2007 01:01 GMT
Once again, Miloz, thank you!
I used the ExecuteScalar method without any trouble at all. In fact, that
was the last piece of the puzzel for my current page. Now off to the next
one!
It's the bits and pieces of practical, everyday, useful information that
aggregates into a 'tool bag' full of capabilities and you have added some
fine ones to mine.
Jim
> Howdy,
>
[quoted text clipped - 13 lines]
>
> Hope it helps