Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > How to get the number of retrieved columns when doing a SQL Query

Reply
Thread Tools

How to get the number of retrieved columns when doing a SQL Query

 
 
Roman Klimkowicz
Guest
Posts: n/a
 
      09-15-2005
Hello everyone,

i just implement an own search site in MS CRM 1.2, which searches in a
MS-SQL database.

My question is, how to get the number of retrieved columns by a SQL-query??

Any suggestions for me?

Thx...


Greets,

Roman
 
Reply With Quote
 
 
 
 
xianxian
Guest
Posts: n/a
 
      09-16-2005
hi,
i only heard number of retrieved rows ..

SELECT COUNT(column) FROM tablename

but i never heard if u can count number of columns..
isn't it like, as u do SQL query, u will already know what columns u are
retrieving?

why do u need to count the columns that u r retrieving when u already
know the columns that u r going to retrieve?

regards,
xianxian

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Romantschik
Guest
Posts: n/a
 
      09-16-2005
xianxian schrieb:
> hi,
> i only heard number of retrieved rows ..
>
> SELECT COUNT(column) FROM tablename
>
> but i never heard if u can count number of columns..
> isn't it like, as u do SQL query, u will already know what columns u are
> retrieving?
>
> why do u need to count the columns that u r retrieving when u already
> know the columns that u r going to retrieve?
>
> regards,
> xianxian
>
> *** Sent via Developersdex http://www.developersdex.com ***


Sorry I did not mean column but the row - My fault .. too much work


Anyway .. I know how to get the number of rows which where retrieved by
firing a SQL-query in SQL code but I need a .NET Method oder workaround
to read this value...

Any suggestions?

Sorry for the false description in my initial post.

Greets,

Roman
 
Reply With Quote
 
Sachin Saki
Guest
Posts: n/a
 
      09-16-2005
Hi,

Can you more specific to problem. so i can try to provide solution.

Regards,
Sachin Saki
..NET Developer, Capgemini - INDIA

"Romantschik" wrote:

> xianxian schrieb:
> > hi,
> > i only heard number of retrieved rows ..
> >
> > SELECT COUNT(column) FROM tablename
> >
> > but i never heard if u can count number of columns..
> > isn't it like, as u do SQL query, u will already know what columns u are
> > retrieving?
> >
> > why do u need to count the columns that u r retrieving when u already
> > know the columns that u r going to retrieve?
> >
> > regards,
> > xianxian
> >
> > *** Sent via Developersdex http://www.developersdex.com ***

>
> Sorry I did not mean column but the row - My fault .. too much work
>
>
> Anyway .. I know how to get the number of rows which where retrieved by
> firing a SQL-query in SQL code but I need a .NET Method oder workaround
> to read this value...
>
> Any suggestions?
>
> Sorry for the false description in my initial post.
>
> Greets,
>
> Roman
>

 
Reply With Quote
 
Elton Wang
Guest
Posts: n/a
 
      09-16-2005
If you retrieve your query result to a datatable, datatable.Rows.Count gives
you row numbers.

HTH

"Romantschik" <(E-Mail Removed)> wrote in message
news:u%23$h$(E-Mail Removed)...
> xianxian schrieb:
> > hi,
> > i only heard number of retrieved rows ..
> >
> > SELECT COUNT(column) FROM tablename
> >
> > but i never heard if u can count number of columns..
> > isn't it like, as u do SQL query, u will already know what columns u are
> > retrieving?
> >
> > why do u need to count the columns that u r retrieving when u already
> > know the columns that u r going to retrieve?
> >
> > regards,
> > xianxian
> >
> > *** Sent via Developersdex http://www.developersdex.com ***

>
> Sorry I did not mean column but the row - My fault .. too much work
>
>
> Anyway .. I know how to get the number of rows which where retrieved by
> firing a SQL-query in SQL code but I need a .NET Method oder workaround
> to read this value...
>
> Any suggestions?
>
> Sorry for the false description in my initial post.
>
> Greets,
>
> Roman



 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
AccessDataSource - how to get access to the retrieved data? Martin ASP .Net Web Controls 3 10-17-2006 12:45 PM
Build dynamic sql query for JSTL <sql:query> Anonymous Java 0 10-13-2005 10:01 PM
How to the get to number of retrieved columns? Roman Klimkowicz ASP .Net Datagrid Control 1 09-18-2005 11:30 PM
various ways of manipulating database retrieved data... Simnet ASP .Net 0 12-03-2004 02:46 PM



Advertisments