Ya i am trying to create custom module but i dont know how to pass username or userid into stored procedure
here is my code:
Dim conn As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Visual Studio 2008\WebSites\Dnn13\App_Data\Database.mdf;Integrated Security=True;User Instance=True")
conn.Open()
Dim cmd As New SqlCommand("firsttime", conn)
cmd.CommandType = CommandType.StoredProcedure
Dim obj As Object
obj = cmd.ExecuteScalar()
conn.Close()
If (obj = 1) Then
Response.Redirect("http://www.gmail.com/")
Else
Response.Redirect("http://www.google.com/")
End If
here is stored procedure:
ALTER PROCEDURE firsttime
@IsNewUser bit,
@UserID int,
@Username nvarchar(100)
AS
SELECT IsNewUser from dbo.Users
WHERE UserID = @UserID and Username=@Username