Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - how do i collect sql data field as variable?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how do i collect sql data field as variable?

 Post Reply Post Reply
Author
Dan H View Drop Down
Newbie
Newbie


Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan H Quote  Post ReplyReply Direct Link To This Post Topic: how do i collect sql data field as variable?
    Posted: 27 April 2008 at 1:18am
Visual web dev 2005 and sql server 2005 express- new to asp.net (some asp experience)

SelectCommand="SELECT Base AS Expr1, CountBase AS Expr2, BlockCost AS Expr3, CountBlock AS Expr4, Record AS Expr5 FROM Billing ORDER BY Expr5 DESC">

I assume the 'Expr1', etc are going to be my variables? Adding <%=Expr1%> to text causes 'not declared' error.
Inserting Dim Expr1 generates a page of various error messages.
 
I need some beginners' help here!
Thanks.
Back to Top
Dan H View Drop Down
Newbie
Newbie


Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan H Quote  Post ReplyReply Direct Link To This Post Posted: 27 April 2008 at 6:13pm
Ok- I'm part way there...
'FormView' gives me a way to mix the selected datafields with text. Very cool, but I still haven't figured out how to get the data to fit into variables so I can formatstring or otherwise manipulate them.
Help?
Back to Top
__n3o__ View Drop Down
Groupie
Groupie
Avatar

Joined: 08 November 2005
Location: United Kingdom
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote __n3o__ Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2008 at 10:55am
Hi Dan..

Why are you selecting everything as something?  Why don't you just do a normal select statement? Confused

SelectCommand="SELECT Base, CountBase, BlockCost, CountBlock, Record FROM Billing ORDER BY Record DESC"

If you paste your code and let me know what your trying to do I'll see if I can help

Back to Top
jamie.townsend View Drop Down
Groupie
Groupie


Joined: 07 December 2007
Location: England
Status: Offline
Points: 114
Post Options Post Options   Thanks (0) Thanks(0)   Quote jamie.townsend Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2008 at 12:28pm
I find working with a repeater is easist if you are going to be formatting the variables.

http://www.w3schools.com/ASPNET/aspnet_repeater.asp


Edited by jamie.townsend - 27 May 2008 at 12:35pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.