Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim CurrentUserName As String = ""
CurrentUserName = Session("UserAuthentication")
Dim cus = From p In db.Users
Where (p.UserUsername.Trim() = CurrentUserName)
Select p
For Each m In cus
txtName.Text = m.UserName
txtAddress.Text = m.UserAddress
txtProvince.Text = m.UserProvince
txtPhone.Text = m.UserPhone
txtEmail.Text = m.UserEmail
txtDate.Text = m.UserDate
Next
End Sub
Sub Page_Load(sender As Object, e As EventArgs)
strConnString = "Server=localhost;Uid=sa;PASSWORD=;database=mydatabase;Max Pool Size=400;Connect Timeout=600;"
objConn.ConnectionString = strConnString
objConn.Open()
IF Not Page.IsPostBack() Then
'*** DataTable ***'
Dim dtAdapter As SqlDataAdapter
Dim dt As New DataTable
strSQL = "SELECT * FROM customer WHERE CustomerID = '"& Request.QueryString("CustomerID") &"' "
dtAdapter = New SqlDataAdapter(strSQL, objConn)
dtAdapter.Fill(dt)
If dt.Rows.Count > 0 Then
Me.txtCustomerID.Text = dt.Rows(0)("CustomerID")
Me.txtName.Text = dt.Rows(0)("Name")
Me.txtEmail.Text = dt.Rows(0)("Email")
Me.txtCountryCode.Text = dt.Rows(0)("CountryCode")
Me.txtBudget.Text = dt.Rows(0)("Budget")
Me.txtUsed.Text = dt.Rows(0)("Used")
End IF
End IF
End Sub