Hi
I don't know if you are using OLDEB or SQL but it doesn't really matter
except you have to choose the right object for your solution.
Use an Oledbcommand (or sqlcommand) and then use the "ExecuteScalar"
Asuming you have a myConnection object already.. here's an example
Dim myCommand As New SqlCommand("SELECT [Anvandare_Fornamn] FROM
[WebappOrders_Mailbox] WHERE [AnvandareUserid] = " & "'" & anvid & "'",
myConnection)
Dim myVariable As String
myConnection.Open()
myVariable = myCommand.ExecuteScalar
myConnection.Close()
Best Regards/
Lars Netzel
"Lelle" <sv****@hotmail.com> wrote in message
news:eK**************@TK2MSFTNGP14.phx.gbl...
hello!
how can i return this value to a varible instead of bind it to a gridview
Me.GridView2.DataSource = Me.SqlDataSource1
Me.SqlDataSource1.SelectCommand = "SELECT [Anvandare_Fornamn] FROM
[WebappOrders_Mailbox] WHERE [AnvandareUserid] = " & "'" & anvid & "'"
Me.GridView2.DataBind()
/ kind.... Lelle