plz check y there is an erro in reading data
-
errror generate when the data reader read.i have made the login project, the error write that (Incorrect syntax near the keyword 'user') . but there is not a problem in table name because i have change it to users than it will give different error the error occurred in loReader = loCommand.ExecuteReader() Imports System Imports System.Data.Sql Imports System.Data Imports System.Data.SqlClient Partial Public Class _Default Inherits System.Web.UI.Page Public Shared lsConnectionString As String Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate Dim loConnection = New SqlConnection(lsConnectionString) Dim loCommand As New SqlCommand("SELECT * FROM user", loConnection) Dim lsUsername, lsPassword, lsUserType, lsstatus, lscount As String Dim loReader As SqlDataReader 'Dim abc As IDataReader loConnection.Open() error here loReader = loCommand.ExecuteReader() 'abc = loCommand.ExecuteReader() loReader = loCommand.ExecuteReader While loReader.Read() lsUsername = CStr(loReader("username")) lsPassword = CStr((loReader("password"))) lsUserType = CStr((loReader("usertype"))) End While loConnection.Close() End Sub End Class
-
errror generate when the data reader read.i have made the login project, the error write that (Incorrect syntax near the keyword 'user') . but there is not a problem in table name because i have change it to users than it will give different error the error occurred in loReader = loCommand.ExecuteReader() Imports System Imports System.Data.Sql Imports System.Data Imports System.Data.SqlClient Partial Public Class _Default Inherits System.Web.UI.Page Public Shared lsConnectionString As String Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate Dim loConnection = New SqlConnection(lsConnectionString) Dim loCommand As New SqlCommand("SELECT * FROM user", loConnection) Dim lsUsername, lsPassword, lsUserType, lsstatus, lscount As String Dim loReader As SqlDataReader 'Dim abc As IDataReader loConnection.Open() error here loReader = loCommand.ExecuteReader() 'abc = loCommand.ExecuteReader() loReader = loCommand.ExecuteReader While loReader.Read() lsUsername = CStr(loReader("username")) lsPassword = CStr((loReader("password"))) lsUserType = CStr((loReader("usertype"))) End While loConnection.Close() End Sub End Class
-
errror generate when the data reader read.i have made the login project, the error write that (Incorrect syntax near the keyword 'user') . but there is not a problem in table name because i have change it to users than it will give different error the error occurred in loReader = loCommand.ExecuteReader() Imports System Imports System.Data.Sql Imports System.Data Imports System.Data.SqlClient Partial Public Class _Default Inherits System.Web.UI.Page Public Shared lsConnectionString As String Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate Dim loConnection = New SqlConnection(lsConnectionString) Dim loCommand As New SqlCommand("SELECT * FROM user", loConnection) Dim lsUsername, lsPassword, lsUserType, lsstatus, lscount As String Dim loReader As SqlDataReader 'Dim abc As IDataReader loConnection.Open() error here loReader = loCommand.ExecuteReader() 'abc = loCommand.ExecuteReader() loReader = loCommand.ExecuteReader While loReader.Read() lsUsername = CStr(loReader("username")) lsPassword = CStr((loReader("password"))) lsUserType = CStr((loReader("usertype"))) End While loConnection.Close() End Sub End Class