0
Hi Micalgray,
Here is your desired code.Run the attachments.
Imports System.Data
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim strConnString As String = System.Configuration.ConfigurationManager.ConnectionStrings.Item("ConnectionString").ToString()
Dim con As New SqlConnection(strConnString)
Dim str As String
Dim com As SqlCommand
Dim obj As Object
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
con.Open()
Session("username") = TextBox1.Text
Session("password") = TextBox2.Text
str = ("Select count(*) from Login where UserName='" + Session("username") & "' and Password ='") + Session("password") & "' "
Dim com As New SqlCommand(str, con)
obj = com.ExecuteScalar()
If CInt(obj) <> 0 Then
Response.Redirect("Welcomeuser.aspx")
Else
Response.Redirect("invalid.aspx")
End If
con.Close()
End Sub
End Class
Thanks
If this post helps you mark it as answer
Accepted 0
Hi Micalgray,
If this post helps you mark it as answer
Thanks
0
Hi Micalgray,
Please go through Our recommended articles section.
Thanks