L
Learner
Hello,
This my a method to call a stored proce and uses a DataReader to read
the data
in the below method I am trying to assign a null value to my datareader
variable
Dim datareader As SqlDataReader
datareader = null
but it doesn't accept.
**********************************
Public Function GetDealers() As SqlDataReader
Dim strSql As String
Dim datareader As SqlDataReader
Try
Dim conn As IDbConnection = GetConnection()
Try
Dim cmd As IDbCommand = conn.CreateCommand()
strSql = "USP_GetDealers"
cmd.CommandText = strSql
cmd.CommandType = CommandType.StoredProcedure
conn.Open()
datareader =
cmd.ExecuteReader(CommandBehavior.CloseConnection)
Finally
End Try
Catch ex As Exception
End Try
Return datareader
End Function
*************************************************
Can some one help me with this..
-L
This my a method to call a stored proce and uses a DataReader to read
the data
in the below method I am trying to assign a null value to my datareader
variable
Dim datareader As SqlDataReader
datareader = null
but it doesn't accept.
**********************************
Public Function GetDealers() As SqlDataReader
Dim strSql As String
Dim datareader As SqlDataReader
Try
Dim conn As IDbConnection = GetConnection()
Try
Dim cmd As IDbCommand = conn.CreateCommand()
strSql = "USP_GetDealers"
cmd.CommandText = strSql
cmd.CommandType = CommandType.StoredProcedure
conn.Open()
datareader =
cmd.ExecuteReader(CommandBehavior.CloseConnection)
Finally
End Try
Catch ex As Exception
End Try
Return datareader
End Function
*************************************************
Can some one help me with this..
-L