Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 17th, 2004, 08:50 AM
Authorized User
 
Join Date: Jul 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default Very Simple SQL Question??

I know this is easy...but I am having some differcultiy with it.

I am tring to get the City ID out of User Table...

I have the SQL string:
strSQL = "SELECT Name, City, Province FROM [User]"
strSQL = strSQL & "WHERE UserID = ' & mUserID & '"

How do I get the city value out this SQL string... Can I say some like, Create a datareader called objDR and set a var equal to objDR(city)??

Please help...

Thanks In Advance,
Mark



 
Old September 17th, 2004, 11:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Yes,

Or use:

SQLDataAdapter.Fill(objTable) 'DataTable

if (objtable.Rows.Count > 0) then
  'get the value as:
  objtable.Rows(<index>).Item("City").ToString()

  'Or whatever else
end if

Brian
 
Old September 20th, 2004, 09:31 AM
Authorized User
 
Join Date: Jul 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks I have it now.

 
Old September 20th, 2004, 08:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

OK, good.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Question JEHalm BOOK: Beginning Access VBA 0 December 29th, 2005 10:42 AM
Simple Question - SQL Statement mrideout BOOK: Beginning ASP.NET 1.0 2 January 11th, 2005 09:28 AM
Simple Question dinosaur_uk VB.NET 2002/2003 Basics 1 September 10th, 2004 09:43 AM
Simple SQL Question cjmarek Classic ASP Databases 1 July 10th, 2004 04:11 AM
Simple Question - SQL for retrieving different row wanda46 Access 5 June 9th, 2004 01:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.