G
Guest
i have and asp.net application that uses an access database
i use dbcom for database application for ex
Imports Syste
Imports System.Dat
Imports System.Data.OleD
Imports System.Configuratio
Namespace Intranet.Common.Data.Access.Co
Public Class dbco
Implements IDisposabl
#Region "Private Fields
'connection to data sourc
Private con As OleDbConnectio
'Error Message fiel
Private _errorMessage As Strin
#End Regio
#Region "Public Properties
Public ReadOnly Property ErrorMessage() As Strin
Ge
Return _errorMessag
End Ge
End Propert
Public Shared ReadOnly Property ConnectionString() As Strin
Ge
'Return System.Configuration.ConfigurationSettings.AppSettings("Database.DEFAULT_CONNECTION_STRING"
Return System.Configuration.ConfigurationSettings.AppSettings
("ConnectionString"
End Ge
End Propert
#End Regio
#Region "Public Method Implementations
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'This function takes a stored proc name and returns an integer
'by invoking ExecuteScalar() on the OleDbCommand type instance
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function RunProcedure(ByVal procName As String) As Intege
Dim result As Intege
Dim cmd As OleDbComman
Tr
cmd = CreateCommand(procName, Nothing
result = CType(cmd.ExecuteScalar(), Integer
Catch e As Exceptio
result = -
_errorMessage = e.Messag
Finall
Me.Close(
End Tr
Return resul
End Functio
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'This function takes a stored proc name, sql parameters returns an integer
'by invoking ExecuteScalar() on the SqlCommand type instance
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function RunProcedure(ByVal procName As String, ByVal prams As OleDbParameter()) As Intege
Dim result As Intege
Dim cmd As OleDbComman
Tr
cmd = CreateCommand(procName, prams
result = cmd.ExecuteScalar(
Catch e As Exceptio
result = -
_errorMessage = e.Messag
Finall
Me.Close(
End Tr
Return resul
End Functio
......................................End Namespac
i use these i
Imports Syste
Imports System.Dat
Imports System.Data.OleD
Imports System.Configuratio
Imports Alliance.Intranet.Common.Data.Access.Co
Namespace Intranet.Common.Business.Logic.Co
Public Class CustomerBi
Implements IDisposabl
#Region "Private Fields
'connection to data sourc
Private con As OleDbConnectio
'Error Message fiel
Private _errorMessage As Strin
#End Regio
#Region "Public Properties
Public ReadOnly Property ErrorMessage() As Strin
Ge
Return _errorMessag
End Ge
End Propert
Public Shared ReadOnly Property ConnectionString() As Strin
Ge
'Return System.Configuration.ConfigurationSettings.AppSettings("Database.DEFAULT_CONNECTION_STRING"
Return System.Configuration.ConfigurationSettings.AppSettings
("ConnectionString"
End Ge
End Propert
#End Regio
#Region "Public Method Implementations
'********************************************************************
' CheckLogin Metho
' The CheckLogin method reads a user login and password and check
' to see if it is in the database
'*********************************************************************
Public Shared Function CheckLogIn(ByVal PlayerGameName As String, ByVal PlayerPassword As String) As OleDbDataReader
'
Dim ObjReturnDR As OleDbDataReader
Dim params(1) As OleDbParameter
Dim db As New dbcom
params(0) = db.MakeParameter("@PlayerName", PlayerGameName)
params(1) = db.MakeParameter("@PlayerPassword", PlayerPassword)
db.RunProcedure("sp_Player_CheckLogin", params, ObjReturnDR)
If ObjReturnDR Is Nothing Then
Throw New Exception(db.ErrorMessage)
End If
Return ObjReturnDR
End Function
i use similar code to insert into tables i can insert 6 records into a table and then i get unspecified error
it is not always at the same spot in the code it can and will be in different functions
any ideas this is not a big database and right now i am the only one using it(trying to test it) so there are not concurrent users
i use dbcom for database application for ex
Imports Syste
Imports System.Dat
Imports System.Data.OleD
Imports System.Configuratio
Namespace Intranet.Common.Data.Access.Co
Public Class dbco
Implements IDisposabl
#Region "Private Fields
'connection to data sourc
Private con As OleDbConnectio
'Error Message fiel
Private _errorMessage As Strin
#End Regio
#Region "Public Properties
Public ReadOnly Property ErrorMessage() As Strin
Ge
Return _errorMessag
End Ge
End Propert
Public Shared ReadOnly Property ConnectionString() As Strin
Ge
'Return System.Configuration.ConfigurationSettings.AppSettings("Database.DEFAULT_CONNECTION_STRING"
Return System.Configuration.ConfigurationSettings.AppSettings
("ConnectionString"
End Ge
End Propert
#End Regio
#Region "Public Method Implementations
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'This function takes a stored proc name and returns an integer
'by invoking ExecuteScalar() on the OleDbCommand type instance
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function RunProcedure(ByVal procName As String) As Intege
Dim result As Intege
Dim cmd As OleDbComman
Tr
cmd = CreateCommand(procName, Nothing
result = CType(cmd.ExecuteScalar(), Integer
Catch e As Exceptio
result = -
_errorMessage = e.Messag
Finall
Me.Close(
End Tr
Return resul
End Functio
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'This function takes a stored proc name, sql parameters returns an integer
'by invoking ExecuteScalar() on the SqlCommand type instance
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function RunProcedure(ByVal procName As String, ByVal prams As OleDbParameter()) As Intege
Dim result As Intege
Dim cmd As OleDbComman
Tr
cmd = CreateCommand(procName, prams
result = cmd.ExecuteScalar(
Catch e As Exceptio
result = -
_errorMessage = e.Messag
Finall
Me.Close(
End Tr
Return resul
End Functio
......................................End Namespac
i use these i
Imports Syste
Imports System.Dat
Imports System.Data.OleD
Imports System.Configuratio
Imports Alliance.Intranet.Common.Data.Access.Co
Namespace Intranet.Common.Business.Logic.Co
Public Class CustomerBi
Implements IDisposabl
#Region "Private Fields
'connection to data sourc
Private con As OleDbConnectio
'Error Message fiel
Private _errorMessage As Strin
#End Regio
#Region "Public Properties
Public ReadOnly Property ErrorMessage() As Strin
Ge
Return _errorMessag
End Ge
End Propert
Public Shared ReadOnly Property ConnectionString() As Strin
Ge
'Return System.Configuration.ConfigurationSettings.AppSettings("Database.DEFAULT_CONNECTION_STRING"
Return System.Configuration.ConfigurationSettings.AppSettings
("ConnectionString"
End Ge
End Propert
#End Regio
#Region "Public Method Implementations
'********************************************************************
' CheckLogin Metho
' The CheckLogin method reads a user login and password and check
' to see if it is in the database
'*********************************************************************
Public Shared Function CheckLogIn(ByVal PlayerGameName As String, ByVal PlayerPassword As String) As OleDbDataReader
'
Dim ObjReturnDR As OleDbDataReader
Dim params(1) As OleDbParameter
Dim db As New dbcom
params(0) = db.MakeParameter("@PlayerName", PlayerGameName)
params(1) = db.MakeParameter("@PlayerPassword", PlayerPassword)
db.RunProcedure("sp_Player_CheckLogin", params, ObjReturnDR)
If ObjReturnDR Is Nothing Then
Throw New Exception(db.ErrorMessage)
End If
Return ObjReturnDR
End Function
i use similar code to insert into tables i can insert 6 records into a table and then i get unspecified error
it is not always at the same spot in the code it can and will be in different functions
any ideas this is not a big database and right now i am the only one using it(trying to test it) so there are not concurrent users