Herzlich Willkommen
<%=Page.User.Identity.Name %>
<%@ import Namespace="MySql.Data.MySqlClient"%>
<%@import Namespace="System.Data.SqlClient" %>
<%
Dim Connectionstring As String = String.Empty
Dim username As String = Me.Page.User.Identity.Name
Dim lastloggedin As String = String.Empty
Dim createdUserDate As String = String.Empty
Dim emailuser As String = String.Empty
Dim CustomerID As String = String.Empty
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
'ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=sa;Pwd=BmWr501956"
Connectionstring = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
Else
Connectionstring = "Server=DEVELOPER.verag.ost.dmn\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
'ConnectionString = "Server=db593295684.db.1and1.com;Database=db593295684;Uid=dbo593295684;Pwd=atilla#2;"
End If
' Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
Using con As New SqlConnection(Connectionstring)
' Using cmd As New SqlCommand("Validate_User")
Using cmd As New SqlCommand("SELECT Username,Email,LastLoginDate,CreatedDate,KundenNr FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username")
' cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@Username", username)
cmd.Connection = con
con.Open()
'userId = Convert.ToInt32(cmd.ExecuteScalar())
Dim dr As SqlDataReader = cmd.ExecuteReader()
If dr.Read() Then
username = dr("Username").ToString()
CustomerID = dr("KundenNr").ToString
End If
End Using
con.Close()
End Using
%>