Thx Ken
I was thinking of cookie and i know it could have been the best options.
But it won't work for them because u have multiple user to one PC!
By the way 'm having a problem when i'm checking the user in the DB.When
i load the page 'm always getting the ACCESS DENIED PAGE..which seems it
inserts the USER before checking.
Am i missing something??
My SProcedure and my ASP.NET below :-
CREATE procedure oyinbo(@username varchar(50) ) as
if exists
-- You cannot register usernames already registered on the database
twice.
(
select username from survey where username = @username
)
--insert survey(username,DateCreated) values(@username,getdate())
return 1 else
insert survey(username,DateCreated) values(@username,getdate())
GO
AND MY ASP.NET CODE:-
Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
conn = New
SqlConnection("server=(local);database=Wintergreen ;integrated
security=true;")
conn.Open()
txtuser.ID = Request.ServerVariables("LOGON_USER")
cmdcommand = New SqlCommand("sp_checkusers", conn)
cmdcommand.CommandType = CommandType.StoredProcedure
param = cmdcommand.Parameters.Add("ReturnValue", SqlDbType.Int)
param.Direction = ParameterDirection.ReturnValue
cmdcommand.Parameters.Add("@username", txtuser.Name)
cmdcommand.Parameters.Add(New SqlParameter("@DateCreated",
SqlDbType.DateTime, 8))
cmdcommand.Parameters("@DateCreated").Value = Now()
cmdcommand.ExecuteNonQuery()
If cmdcommand.Parameters("ReturnValue").Value = 0 Then
Response.redirect("noaccess.aspx")
' lblMessage.Text = "Username already exists!"
'Else
' lblMessage.Text = "Success!"
REsponse.Redirect("startsurvey.aspx")
End If
conn.Close()
End Sub
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!