J
Jim in Arizona
Is there an easy way to just get a single value from a database and put
it into a string?
This is as far as I can get:
Dim TKEY As String
TKEY = dlShowRequests.DataKeys(e.Item.ItemIndex)
Dim strConnection, strSQL, strADName As String
strConnection = ConfigurationManager.AppSettings("maintenance")
strSQL = "SELECT empname FROM TWorkRequest WHERE ID = " & TKEY
Dim objConnection As New SqlConnection(strConnection)
Dim objCommand As New SqlCommand(strSQL, objConnection)
objConnection.Open()
objCommand.ExecuteReader()
objConnection.Close()
Normally, I could use a control, like a gridview, and use the datasource
then databind property/method to get the data. But, how could I simply
just put the single value, which my SQL string would produce, into a
single string variable?
I thought about just making a label or textbox object and binding it to
that but they don't have datasource properties.
it into a string?
This is as far as I can get:
Dim TKEY As String
TKEY = dlShowRequests.DataKeys(e.Item.ItemIndex)
Dim strConnection, strSQL, strADName As String
strConnection = ConfigurationManager.AppSettings("maintenance")
strSQL = "SELECT empname FROM TWorkRequest WHERE ID = " & TKEY
Dim objConnection As New SqlConnection(strConnection)
Dim objCommand As New SqlCommand(strSQL, objConnection)
objConnection.Open()
objCommand.ExecuteReader()
objConnection.Close()
Normally, I could use a control, like a gridview, and use the datasource
then databind property/method to get the data. But, how could I simply
just put the single value, which my SQL string would produce, into a
single string variable?
I thought about just making a label or textbox object and binding it to
that but they don't have datasource properties.