SQL query returned in label

Hey guys. New to the forums but I have enjoyed reading so far.

 My first question for today is...

I have a label on my default page that I want to display the results of a table adapter.

My label is labelTotals

My table adapter is tblLicenseCountAdapter

Can someone help me out please?

7/27/2007 6:21:14 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

7 Replies

Similar Articles

[PageSpeed] 34
Get it on Google Play
Get it on Apple App Store

Is your sql query returning a single value??

Remeber to mark as Answer if someone's answer helped you.
7/27/2007 7:17:03 PM

Yes it is. Im actually just counting the rows for the value.

7/27/2007 7:46:45 PM

Duplicate post for some odd reason.

7/27/2007 7:46:55 PM

if you are just counting rows then are you looking for something like

lblOutput.Text = tableReader.Rows.Count.ToString();

Please remember to click "Mark as Answer" on this post if it helped you.
7/27/2007 7:48:27 PM

is there any other code you can give me to go along with that?

 I have very basic knowledge in the coding aspect. I know how to build adapters and view them in grids but that is using VS 2005.

7/28/2007 12:03:07 AM


Hey guys. New to the forums but I have enjoyed reading so far.

 My first question for today is...

I have a label on my default page that I want to display the results of a table adapter.

My label is labelTotals

My table adapter is tblLicenseCountAdapter

Can someone help me out please?


what is the method called in your table adapter? The code should look like:

if( !IsPostBack)




7/28/2007 2:00:00 AM

I'll try to piece it together from here.

 Thanks guys.

7/28/2007 1:55:56 PM

Similar Artilces:

SQL query returns data, .NET returns #42S22Unknown column binding to dataset
I have a webservice with a common function which calls MYSQL and returns a dataset. Today I encounterd a strange error when performing a Select with a count() in it which I cant figure out. From a command line, the SQL query works fine and returns 9 rows... but VB.NET bombs with an error when filling the data adapter with the returned data. Please see my sample code below, is there an additional flag I need to call to make this work with VB? SQL Command Line: ( Works Great )mysql> Select taction, count(*) from kiosklogs where packageid='NewHi-Def-Test' group by taction;...

Get size of data returned in SQL Query
Hi can anybody tell me how i can return the size of data returned by a query from a SQL Server DB. For example if 45 records are returned and the total size of the data contained within the data record is 70kb i need a way of extracting this data. Thanks in advance for the help....

Getting count of records returned from SQL query
Is there any way to get the count of the number of records returned from an SQL query?  I'm using an SqlDataAdapter to hold the results of the query, but I'd like to add some processing that is dependent on the number of records returned. I think if you can add an output param to your sql procedure, then inside the sql, right after you do the select, set this param to the value of @@ROWCOUNTHope it helps,Joe http://www.joeaudette.comhttp://www.mojoportal.com Actually, I found a way to do it with the DataAdapter.  If you have a DataAdapter ds and you fill it with your ...

Need help getting a return value in SQL Query Analyzer
This has got to be a simple one, but I could not find out how I have this simple proc for test purposes only...   ALTER    PROCEDURE dbo.RotoTest( @strSSN VARCHAR(11), @blnUseACHDate BIT = 0,  @intInvestorId int = 0)ASreturn 5   Thats right it does nothing but return 5 and thats because I removed all the real code to simplify my question. When I hit this proc in SQL Query Analyzer.. exec RotoTest '123-45-6789', 0, 1     No return value is displayed in Query Analyzer. When I try something like this exec RotoTest ...

sql query returns single record
Hi, The sql query I'm using returns single record. I don't what to bind it to a datagrid - is there anyway I can display it in a label? I've been trying to find a way round this for the last couple of hours. Many thanks Hi there, you mean something like this... Dim sqlConn as New SqlConnection ("myserver") Dim sqlCmd as new SqlCmd("Select top 1 * from Customer",sqlConn) Dim dtr as SqldataReader Dim Str as String Try SqlConn.Open() dtr = SqlCmd.ExecuteReader() dtr.Read If dtr.HasRows str=&q...

Free .Net and Sql Server Training Videos for Developers just getting started
I figured since this is the Getting started forum I would mention a great .Net training video site with some free videos.http://www.TechnicalVideos.netThanksMike James...

C# Ado.net Sql query parameter query
Hi All, I'm trying to pass in a parameter value from an array in a loop that is used in a sql query and the results are populated to an xml file. The trouble is that I'm only getting the colums values in the outputted xml file. So I feel that the paramter is not being read. So can anyone help as I'm really stuck on this one. The code is as follows : public void DisplayUserInfo() { ArrayList UserIdArrayList = IdentifyUserID(); foreach(string ShowUserIDString in UserIdArrayList) { try { SqlConnection SqlConn = new SqlConnection(DBConnString)...

Combine sql query from multiple returns to 1 return
the following is my query, what I would like to do is show 1 line for every person instead of  potentiall many.  Most of the information is redundent except for the dates and the count of the dates and mileage.  What I would like to do is combine all the dates into one field and do a count on them for 1 tally as well as the mileage.  Here is how the information come out currently per the query.133RD       F31LFVXG      GASPERSZ       555555555      E3-6  ...

Viewing the Query Plan of a SQL Statement
I a trying to view the query plan of an executing SPID. Here is the SQL I am running & running under sa role: declare @batch int declare @context int declare @statement int execute sp_showplan 141, @batch_id= @batch output, @context_id= @context output, @stmt_num=@statement output I plug in my spid id and the results returned state "The query plan for spid '141' is unavailable. Possibly the query has not started or has finished executing." However, I do get a value for @batch _id , that's 212638, but the @context_id is 0, and the @stmt_num is blank....

ANN: SQL::Catalog
The URL http://princepawn.perlmonk.org/domains/semantic- elements.com/cpan/SQL-Catalog-0.01.tar.gz has entered CPAN as file: $CPAN/authors/id/T/TB/TBONE/SQL-Catalog-0.01.tar.gz NAME SQL::Catalog - test, label, store, search and retrieve SQL queries SYNOPSIS shell% cd sql_lair/city,date/weather/1/ shell% cat concrete.sql select city, date from weather where temp_lo < 20; shell% sql_test concrete.sql shell% cat testexec.out # see results of prepare, execute on this shell% cat abstract.sql select city, date from we...

Can sql queries be nested in sql queries?
I am having problems with a template that uses the information from one sql query to generate a query on another table. Let me be more specific. The template in question receives a category ID value from a web page that provides a menu of several categories to choose from. Each Category ID represents several Items or products to choose from. When the template receives the category ID, the first thing it does is run a query on my item_category table (this table lists all of the items and associates them with the appropriate category). This query returns several itemIDs that are all...

ns1.entrust.net and ns2.entrust.net returning SERVFAIL for AAAA query
This is a multi-part message in MIME format. --------------000409010802080300070100 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Which causes both Firefox and Thunderbird to indicate certificate validation failure when configured to treat OCSP problems as validation failures. Email to entrust.net DNS zone contact bounces. Telephone contacts not fruitful. Similar problem afflicts crl.entrust.net. Is this a topic suitable for this newsgroup, or one of the other Mozilla newsgroups? (Apologies if not). Regards, Gary gapinski@chipotle:~> ...

sqlreader returning false even though Sql query Analyzer returns a result
Hi, I have this problem with my sqlreader, my sql returns a result in analyzer but when I use the same statement in my sqlreader its not returning any results ie returns false.   Can anyone help?   many thanks Hi,1. Are you sure it's EXACTLY the same SQL statement executing on both?2. Are you sure they are both pointing to the same database?If so, post the code and we'll take a look. ...

Query for substring to get some particular value in a string (Get querystring value by sql )
I have a column name URL in Table1 with data like  <a href="/Folder1/view_media_news.cfm?news_media_i=1">August 2002 Factsheet</a>            <a href="/Folder1/view_media_news.cfm?news_media_i=149">March 2002 Newsletter </a>  i need to grab the news_media_i value by sql query  Please any one can help me to get that particular value from string using substring or any other suggestion Thank you in advance SurendraIf this helps mark it as answer surendra_kla:i nee...

Web resources about - SQL query returned in label - asp.net.getting-started

Energy returned on energy invested - Wikipedia, the free encyclopedia
The natural or original sources of energy are not usually included in the calculation of energy invested, only the human-applied sources. For ...

How Facebook Returned A/B Testing To Mobile Apps
When Facebook rewrote its mobile applications and converted them from custom Web stacks to native development stacks, it lost the ability to ...

Facebook temporarily reveals ‘returned value’ metric for ads
Some Facebook advertisers temporarily saw a new metric called “returned value” in their Ads Manager dashboard. Facebook says the metric was accidentally ...

The Night Steve Jobs returned to Apple, Dec 20, 1996 - a set on Flickr
Working late on a Friday on December 20th at Apple Computer as Mac OS Evangelist, my manager came rushing past my office door saying to come ...

Batista reveals why he returned to WWE - YouTube
The Animal talks about overcoming a broken back, his immersion in Jiu-Jitsu training, and his desire to capture the WWE World Heavyweight Championship. ...

Fugitive US businessman Zack Shahin returned to UAE, says spokesman
... a taser following his release. A fugitive American businessman who is facing multi-million dirham corruption charges in Dubai has been returned ...

Bender is back! Belair’s favourite robot returned - AdelaideNow Search Search
GOOD news, everyone! Bender the robot — possibly the coolest letterbox in the Adelaide Hills — has been returned just days after being stolen. ...

'We were all sick': returned asylum seekers tell of lifeboat ordeal to Java
The orange lifeboat wallowing in the shallows off the coast of Central Java is proving to be a highly effective weapon in Australia's military ...

Money returned but Slavich holds onto hope
Money returned but Slavich holds onto hope

Perth student’s camera returned after five years on bottom of Prague river
IT took a Beatles lyric, an aquatics instructor and social media to return Chloe Hutson’s long-lost holiday photographs five years after her ...

Resources last updated: 12/15/2015 3:07:18 AM