J
Jim in Arizona
I'm having trouble pulling a single value from my SQL DB and filling a
string type with it.
Something like:
Dim strConnection As String =
"server=localhost;uid=sa;pwd=password;database=tickets"
Dim objConnection As New SqlConnection(strConnection)
Dim strSQLSubject As String
Dim objCommand As SqlCommand
Dim objReader As SqlDataReader
Dim test As String
strSQLSubject = "SELECT subject FROM TTickets WHERE PK = " & txtID.text
objConnection.Open()
objCommand = New SqlCommand(strSQLSubject, objConnection)
objCommand = New SqlCommand(strSQLSubject, objConnection)
objReader = objCommand.ExecuteReader
test = objReader.Read
Response.Write(test)
objConnection.Close()
This is probably the long way of doing it, I'm sure. It doesn't work
anyway. Its been a while since I've worked with this stuff and if you
don't use it, you lose it.
I'm actually trying to send an email with a single value out of the DB
wtihin the subject line of the email. I got the emailing part down now
(thanks paul), I just can't get this DB part right.
Thanks,
Jim
string type with it.
Something like:
Dim strConnection As String =
"server=localhost;uid=sa;pwd=password;database=tickets"
Dim objConnection As New SqlConnection(strConnection)
Dim strSQLSubject As String
Dim objCommand As SqlCommand
Dim objReader As SqlDataReader
Dim test As String
strSQLSubject = "SELECT subject FROM TTickets WHERE PK = " & txtID.text
objConnection.Open()
objCommand = New SqlCommand(strSQLSubject, objConnection)
objCommand = New SqlCommand(strSQLSubject, objConnection)
objReader = objCommand.ExecuteReader
test = objReader.Read
Response.Write(test)
objConnection.Close()
This is probably the long way of doing it, I'm sure. It doesn't work
anyway. Its been a while since I've worked with this stuff and if you
don't use it, you lose it.
I'm actually trying to send an email with a single value out of the DB
wtihin the subject line of the email. I got the emailing part down now
(thanks paul), I just can't get this DB part right.
Thanks,
Jim