Click here to Skip to main content
15,900,254 members

Comments by vanarajranjit (Top 46 by date)

vanarajranjit 18-Sep-14 12:19pm View    
Can you tell me how to do???
vanarajranjit 17-Jun-14 23:39pm View    
What you saying I am. Not understandable please find the solution
vanarajranjit 17-Jun-14 23:38pm View    
I used like that
Command.parameters. Add("@date",SqlDbType.VarChar.varchar).Value=txtname.Text.
vanarajranjit 17-Jun-14 23:22pm View    
L1missplaced actual dd mm yyyy
vanarajranjit 15-Jun-14 10:59am View    
Actually this is my code how to check the user authenticated or not
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Try
Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("SqlDbConnection").ToString())
Dim command As New SqlCommand("cyl_user_login", con)
command.CommandType = CommandType.StoredProcedure
command.Parameters.Add("@emp_code", SqlDbType.VarChar).Value = txtusername.Text.Trim()
command.Parameters.Add("@user_password", SqlDbType.VarChar).Value = txtpassword.Text.Trim()
con.Open()
command.ExecuteNonQuery()
Session("@emp_code") = txtusername.Text
'Session("user_password") = txtpassword
Response.Redirect("Home.aspx")
con.Close()
Catch ex As Exception
'Label1.Text = "Wrong Password"
'Console.WriteLine("SQL Error" & ex.Message.ToString())
Label1.Text = ex.Message.ToString()
'ScriptManager.RegisterClientScriptBlock(Me, Me.[GetType](), "alertMessage", "alert('" & ex.Message.ToString() & "')", True)
End Try

End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Label1.Text = ""
End Sub

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click

txtusername.Text = ""
txtpassword.Text = ""
End Sub
End Class