use commandObj.ExecuteScalar() to return the single value ...
(i'll use generic objects - you use the proper ones that correspond with
your data provider)
dim conn as new Connection(strConnString)
dim cmd as new Command()
conn.open()
cmd.connection = conn
cmd.comandtext = "select field1 from table1 where pkfield = value"
dim strField1Value as string = cstr(cmd.executeScalar())
conn.close()
the use it ....
control.Text = strField1Value
or
response.write(strField1Value)
if you aren't using ASP.NET ... this is the wrong forum ....
"Josh" <an*******@microsoft.com> wrote in message
news:b7****************************@phx.gbl...
This I'm sure is a silly question, but I am pulling one
field from one particular record and for the life of me
can't figure out how to display/manipulate it. Every
single tutorial or code sample relating asp.net and
database access uses a datagrid, which doesn't help me
here. Can someone please direct me to a resource that
shows the asp.net equivalent of the below code?
strSQL = "SELECT field FROM table WHERE id=1"
Set objRS = objConn.Execute(strSQL)
Response.Write objRS("field")
Thanks,
Josh