Hello sir
I have create the web application but when login from
web site it give me error.
I have use the Stored procedure at login page. Data base is Sql server 2005
This work fine on my local machine or local server(intranet server). but for live server it not work.
My Sp
==
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER proc [dbo].[Usp_CheckLogin]
(
@UserName varchar(150)=NULL
,@Password varchar(150)=NULL
,@UserIP VARCHAR(50) = NULL
,@ByKit BIT = 0
,@LoginBy BIT = 0
)
as
begin
DECLARE @UserId INT
Declare @RowCnt int
set @RowCnt=0
select @RowCnt=Count(*) from dbo.User_Mst where UserName=@UserName and Password=@Password
if (@RowCnt=0)
Begin
Select 0 as returnvalue
End
Else
Begin
Select
1 as returnvalue,
UserID,
UserName,
UserRole,
FirstName + '' + LastName [Name],
FirstName,
[User].OrganizationId,
fk_OrganizationTypeId,
[User].fk_RoleId,
VideoRecording,
ContinueActivity
from dbo.User_Mst [User]
LEFT JOIN Organization [Org]
ON [User].OrganizationId = [Org].pk_OrganizationId
where UserName=@UserName
SELECT @UserId = UserID FROM dbo.User_Mst [User] WHERE UserName=@UserName
INSERT INTO [LoginHistory_Mst]
(
[fk_UserId]
,[UserIP]
,[LogOutTime]
,[ByKit]
,[LoginBy]
)
VALUES
(
@UserId
,@UserIP
,NULL
,@ByKit
,@LoginBy
)
End
end
==
some time it work or some time it give me error for fi
=========
Column 'Username' does not belong to table Table.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Column 'Username' does not belong to table Table.
Source Error:
Line 109: End If
Line 110: Catch ex As Exception
Line 111: Throw ex
Line 112: Finally
Line 113: If IsNothing(dsUser) = False Then
Source File: H:\Inetpub\wwwroot\MRESC_StaticDemo_new\login.aspx.vb Line: 111
Stack Trace:
[ArgumentException: Column 'Username' does not belong to table Table.]
login.ibtnLogin_Click(Object sender, ImageClickEventArgs e) in H:\Inetpub\wwwroot\MRESC_StaticDemo_new\login.aspx.vb:111
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +98
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +161
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981