You are on page 1of 2

============SESSION VERIABLES================

Dim Con As New SqlConnection("Data Source=paxar_is;Initial Catalog=Users;Persist uid=sa;pwd=")


Con.Open()

Dim Da As New SqlDataAdapter("SELECT ID,Email,Status FROM User_Details WHERE UserName = '" & txtuName.Text
& "'", Con)
Dim Dt As New DataTable '("UserName")

Da.Fill(Dt)
Session("CusID") = Trim(Dt.Rows(0).Item(0))
Session("UserName") = Trim(txtuName.Text)
Session("Pass") = Trim(txtpass.Text)
Session("email") = Trim(Dt.Rows(0).Item(1))
Session("status") = Trim(Dt.Rows(0).Item(2))
Response.Redirect("loginin.aspx")

=======IN NEXT PAGE================


Dim uname As String
Dim pas As String
Dim cusId As String
Dim status As String
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

uname = Session("UserName")
pas = Session("Pass")
cusId = Session("CusID")
status = Session("status")
'Response.Write(uname)
'Response.Write(pas)
'Response.Write(cusId)

End Sub
Private Sub LinkButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
LinkButton4.Click
Session("UserName") = uname
Session("Pass") = pas
Session("CusID") = cusId
'Response.Redirect("newcall.aspx?usid=" & uname & "")
Response.Redirect("helpComp.aspx?usid=" & uname & "")
End Sub

======AVOID DUPLICATE ENTER=======

Public Function searchNID() As Boolean


Try
Dim con As New SqlConnection("data source=paxar_is;initial catalog=Esolution2;uid=sa;pwd=")
con.Open()
Dim daa As New SqlDataAdapter("select * from person where NID='" & Trim(TextBox1.Text) & "'",
con)
Dim dt As New DataTable
daa.Fill(dt)
If dt.Rows.Count > 0 Then
searchNID = True
Else
searchNID = False
Exit Function
End If
con.Close()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Function

If searchNID() Then
Label4.Text = " Sorry, EPF No already exist !"
Exit Sub
End If