Click here to Skip to main content
15,923,051 members

Comments by Sathish kumar M S (Top 8 by date)

Sathish kumar M S 1-Aug-14 6:14am View    
Thank you!
when i using your code it is showing error message like this
Error 29 Cannot apply indexing with [] to an expression of type 'object'
Sathish kumar M S 18-Jul-14 4:55am View    
actually I converted code from vb.net to c#
my vb.net code is
Public Overloads Shared Function ExecuteHashTable(ByVal connection As SqlConnection, _
ByVal commandType As CommandType, _
ByVal commandText As String) As Hashtable
Dim oDataReader As System.Data.SqlClient.SqlDataReader
Dim oHashTable As New Hashtable()
oDataReader = ExecuteReader(connection, commandType, commandText, CType(Nothing, SqlParameter()))
Do While oDataReader.Read
oHashTable.Add(CStr(oDataReader.Item(0)).Trim, CStr(oDataReader.Item(1)).Trim)
Loop
oDataReader.Close()
Return oHashTable
End Function
Sathish kumar M S 18-Jul-14 4:53am View    
showing same error message
Sathish kumar M S 18-Jul-14 4:50am View    
error msg showing like this
Sathish kumar M S 18-Jul-14 4:49am View    
Error 62 'System.Data.SqlClient.SqlDataReader' does not contain a definition for 'Item' and no extension method 'Item' accepting a first argument of type 'System.Data.SqlClient.SqlDataReader' could be found (are you missing a using directive or an assembly reference?)