Click here to Skip to main content
15,913,027 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionplease give suggestions Pin
Vinay Dornala8-Apr-07 23:10
Vinay Dornala8-Apr-07 23:10 
QuestionRe: please give suggestions Pin
Abolfazl Sheikhloo8-Apr-07 23:47
Abolfazl Sheikhloo8-Apr-07 23:47 
AnswerRe: please give suggestions Pin
Shajeel9-Apr-07 0:00
Shajeel9-Apr-07 0:00 
AnswerRe: please give suggestions Pin
Sathesh Sakthivel9-Apr-07 0:34
Sathesh Sakthivel9-Apr-07 0:34 
AnswerRe: please give suggestions Pin
Vasudevan Deepak Kumar9-Apr-07 6:13
Vasudevan Deepak Kumar9-Apr-07 6:13 
QuestionUnable to update database Pin
J Liang8-Apr-07 22:23
J Liang8-Apr-07 22:23 
AnswerRe: Unable to update database Pin
_mubashir8-Apr-07 22:44
_mubashir8-Apr-07 22:44 
GeneralRe: Unable to update database Pin
J Liang8-Apr-07 23:09
J Liang8-Apr-07 23:09 
Hi Mubashir,

Thanks for the reply, here's the code

Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim dr As SqlDataReader
Dim currdt As DateTime = DateTime.Now

myConnection = New SqlConnection("server=localhost;uid=aa;pwd=abc;database=ww;Data Source=mysource")
myConnection.Open()

Dim sqlString = "SELECT * FROM [dbo].[user] WHERE email='" & Me.txtEmail.Text & "' AND password='" & Me.txtPwd.Text & "'"

If Me.txtEmail.Text = "" Or Me.txtPwd.Text = "" Then
Me.lblmsg.Text = "Please fill in your email and password"
Else
Try
myCommand = New SqlCommand(sqlString, myConnection)
dr = myCommand.ExecuteReader()
dr.Read()

If dr.HasRows Then
'Set session for later use
Session("uid") = dr(0)
Session("name") = dr(1)
Session("deptid") = dr(2)
Session("title") = dr(3)
Session("grpid") = dr(4)
Session("category") = dr(5)
Session("email") = dr(6)

'Update login time
sqlString = "UPDATE [user] SET logindt='10/9/2007 2:39PM' WHERE email='abc@yahoo.com'"

myCommand = New SqlCommand(sqlString, myConnection)

myCommand.ExecuteNonQuery()

Response.Redirect("main.aspx")
Else
Me.lblmsg.Text = "Email and password incorrect"
End If

dr.Close()
myConnection.Close()
Catch e As Exception
Me.MsgBox(e.ToString())

End Try

End If

Hope this is what you need.

J Liang
GeneralRe: Unable to update database Pin
_mubashir8-Apr-07 23:35
_mubashir8-Apr-07 23:35 
GeneralRe: Unable to update database Pin
J Liang8-Apr-07 23:49
J Liang8-Apr-07 23:49 
GeneralRe: Unable to update database Pin
_mubashir9-Apr-07 0:16
_mubashir9-Apr-07 0:16 
GeneralRe: Unable to update database Pin
J Liang9-Apr-07 0:26
J Liang9-Apr-07 0:26 
GeneralRe: Unable to update database Pin
_mubashir9-Apr-07 0:34
_mubashir9-Apr-07 0:34 
AnswerRe: Unable to update database Pin
Vasudevan Deepak Kumar9-Apr-07 6:14
Vasudevan Deepak Kumar9-Apr-07 6:14 
GeneralRe: Unable to update database Pin
J Liang9-Apr-07 22:25
J Liang9-Apr-07 22:25 
Questionget alert when web page is idle Pin
www.suniltvl.in8-Apr-07 22:20
www.suniltvl.in8-Apr-07 22:20 
AnswerRe: get alert when web page is idle Pin
N a v a n e e t h8-Apr-07 22:54
N a v a n e e t h8-Apr-07 22:54 
AnswerRe: get alert when web page is idle Pin
Vasudevan Deepak Kumar9-Apr-07 6:14
Vasudevan Deepak Kumar9-Apr-07 6:14 
Questionproblem in detect MotherBoard SerialNumber Pin
Abolfazl Sheikhloo8-Apr-07 22:15
Abolfazl Sheikhloo8-Apr-07 22:15 
Questiondates in .net... Pin
Member 38798818-Apr-07 22:03
Member 38798818-Apr-07 22:03 
AnswerRe: dates in .net... Pin
Abolfazl Sheikhloo8-Apr-07 22:19
Abolfazl Sheikhloo8-Apr-07 22:19 
GeneralRe: dates in .net... Pin
Member 38798818-Apr-07 22:36
Member 38798818-Apr-07 22:36 
QuestionHow to Create a Ribbon Bar? Pin
Smitha Appukuttan8-Apr-07 21:34
Smitha Appukuttan8-Apr-07 21:34 
AnswerRe: How to Create a Ribbon Bar? Pin
Vasudevan Deepak Kumar9-Apr-07 6:15
Vasudevan Deepak Kumar9-Apr-07 6:15 
QuestionYearwise scroll in Calender control of ASP.NET 2.0 Pin
varshavmane8-Apr-07 21:28
varshavmane8-Apr-07 21:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.