M
moondaddy
I just downloaded the TaskVision smart client app for review. I think it
was built in 1.0, however, i'm runnint 2.0. VS 2005 upgraded it and now I
have a vew compile errors. One I dont know how to resolve is in the class
SQLHelper where its trying to return a sqldatareader from a shared method.
the compile error is:
Error 39 Overload resolution failed because no accessible 'ExecuteReader'
can be called without a narrowing conversion:
'Public Shared Overloads Function ExecuteReader(connectionString As
String, spName As String, ParamArray parameterValues() As Object) As
System.Data.SqlClient.SqlDataReader': Argument matching parameter
'connectionString' narrows from 'System.Data.CommandType' to 'String'.
D:\nwis\Apps\SampleCode\SmartClientApps\TaskVision\Microsoft.ApplicationBlocks.Data\SQLHelper.vb
772 24 Microsoft.ApplicationBlocks.Data
and the method is:
Public Overloads Shared Function ExecuteReader(ByVal connection As
SqlConnection, _
ByVal spName As
String, _
ByVal ParamArray
parameterValues() As Object) As SqlDataReader
'pass through the call using a null transaction value
'Return ExecuteReader(connection, CType(Nothing,
SqlTransaction), spName, parameterValues)
Dim commandParameters As SqlParameter()
'if we receive parameter values, we need to figure out where
they go
If Not (parameterValues Is Nothing) And parameterValues.Length >
0 Then
commandParameters =
SqlHelperParameterCache.GetSpParameterSet(connection.ConnectionString,
spName)
AssignParameterValues(commandParameters, parameterValues)
Return ExecuteReader(CommandType.StoredProcedure, spName,
commandParameters)
'otherwise we can just call the SP without params
Else
Return ExecuteReader(connection,
CommandType.StoredProcedure, spName)
End If
End Function 'ExecuteReader
Any idea on how to resolve this?
Thanks.
was built in 1.0, however, i'm runnint 2.0. VS 2005 upgraded it and now I
have a vew compile errors. One I dont know how to resolve is in the class
SQLHelper where its trying to return a sqldatareader from a shared method.
the compile error is:
Error 39 Overload resolution failed because no accessible 'ExecuteReader'
can be called without a narrowing conversion:
'Public Shared Overloads Function ExecuteReader(connectionString As
String, spName As String, ParamArray parameterValues() As Object) As
System.Data.SqlClient.SqlDataReader': Argument matching parameter
'connectionString' narrows from 'System.Data.CommandType' to 'String'.
D:\nwis\Apps\SampleCode\SmartClientApps\TaskVision\Microsoft.ApplicationBlocks.Data\SQLHelper.vb
772 24 Microsoft.ApplicationBlocks.Data
and the method is:
Public Overloads Shared Function ExecuteReader(ByVal connection As
SqlConnection, _
ByVal spName As
String, _
ByVal ParamArray
parameterValues() As Object) As SqlDataReader
'pass through the call using a null transaction value
'Return ExecuteReader(connection, CType(Nothing,
SqlTransaction), spName, parameterValues)
Dim commandParameters As SqlParameter()
'if we receive parameter values, we need to figure out where
they go
If Not (parameterValues Is Nothing) And parameterValues.Length >
0 Then
commandParameters =
SqlHelperParameterCache.GetSpParameterSet(connection.ConnectionString,
spName)
AssignParameterValues(commandParameters, parameterValues)
Return ExecuteReader(CommandType.StoredProcedure, spName,
commandParameters)
'otherwise we can just call the SP without params
Else
Return ExecuteReader(connection,
CommandType.StoredProcedure, spName)
End If
End Function 'ExecuteReader
Any idea on how to resolve this?
Thanks.