[thelist] ASP.NET displaying data on a page

Ken Schaefer Ken at adOpenStatic.com
Wed Aug 10 21:42:31 CDT 2005


In the simplest case, your dataset has a datatable. A datatable has datarows.
Each datarow has an item collection, which represents the "columns" in the
datarow.

I'm currently out of town and don't have my copy of ASP.NET Unleashed handy,
but I'm pretty certain this is all covered in the chapters on using ADO.NET.

Also, your SQL code is subject to SQL injection attack. ASP.NET unleashed
covers how to use parameters in your SQL statements.

Cheers
Ken

--
www.adOpenStatic.com/cs/blogs/ken/ 

: -----Original Message-----
: From: thelist-bounces-ken=adopenstatic.com at lists.evolt.org
: [mailto:thelist-bounces-ken=adopenstatic.com at lists.evolt.org] On Behalf Of
: Casey
: Sent: Thursday, 11 August 2005 12:05 PM
: To: thelist at lists.evolt.org
: Subject: Re: [thelist] ASP.NET displaying data on a page
: 
: Oops.  Sent this just to Ken the first time.  Try again...
: 
: ----- Original Message -----
: From: "Ken Schaefer" <Ken at adOpenStatic.com>
: 
: > When you want to display this stuff, you can assign data from the
: dataset
: (or
: > a datatable in the dataset) to label controls, or literal controls, or
: > whatever you want
: 
: Okay.  That makes lots of sense.  Here's what I've got so far:
: 
: Sub Page_Load(Src As Object, E As EventArgs)
: 
: dim getDoc as string=request.querystring("id")
: 
: dim dsDocs as Dataset = New DataSet()
: 
: Dim conDocs as SqlConnection = New SqlConnection( "server='123.abc.com';
: user id='xyz'; password='xxx'; database='zzz'" )
: 
: Dim daDocs as SqlDataAdapter = New SqlDataAdapter( "SELECT fname FROM
: doctors WHERE doc_id= '" & getDoc & "'", conDocs )
: 
: daDocs.fill(dsDocs)
: 
: lblDocfname.Text=?????
: 
: end sub
: 
: Am I even headed in the right direction?  I'm getting this from ASP.NET
: Unleashed, just FYI.  What would I put in place of the ??? to populate the
: label with the contents of fname?
: 
: TIA



More information about the thelist mailing list