G
Guest
Hi can someone please tell me how I get the value of a function from a
control into a standard aspx page???
Thanks...
Function GetOffice()
Dim Myconn As New
SqlConnection(ConfigurationSettings.AppSettings("strConn"))
Dim cmd As New SqlCommand("UserDetails", Myconn)
cmd.CommandType = CommandType.StoredProcedure
Myconn.Open()
Dim objParam1 As SqlParameter
objParam1 = cmd.Parameters.Add("@UserName", SqlDbType.Char)
objParam1.Direction = ParameterDirection.Input
objParam1.Value = Page.User.Identity.Name
Dim myReader As SqlDataReader = cmd.ExecuteReader()
While myReader.Read()
If Page.User.Identity.Name <> "" Then
Dim OfficeID As String
OfficeID = myReader("offName")
End If
End While
' always call Close when done reading.
myReader.Close()
' Close the connection when done with it.
Myconn.Close()
End Function
control into a standard aspx page???
Thanks...
Function GetOffice()
Dim Myconn As New
SqlConnection(ConfigurationSettings.AppSettings("strConn"))
Dim cmd As New SqlCommand("UserDetails", Myconn)
cmd.CommandType = CommandType.StoredProcedure
Myconn.Open()
Dim objParam1 As SqlParameter
objParam1 = cmd.Parameters.Add("@UserName", SqlDbType.Char)
objParam1.Direction = ParameterDirection.Input
objParam1.Value = Page.User.Identity.Name
Dim myReader As SqlDataReader = cmd.ExecuteReader()
While myReader.Read()
If Page.User.Identity.Name <> "" Then
Dim OfficeID As String
OfficeID = myReader("offName")
End If
End While
' always call Close when done reading.
myReader.Close()
' Close the connection when done with it.
Myconn.Close()
End Function