T
Thomas Scheiderich
I am having a problem with a Datatable access.
This statement apparently works fine:
response.write(GetRows.Rows(ktr)(1))
and this statement does not:
if e.day.date = GetRows(ktr)(1) then
Here is the snippet of code that has these statements
**********************************************************************
Dim GetRows as DataTable = sqlDS.tables("eventCalendar")
Dim totalRows as integer
Dim totalColumns as Integer
totalRows = GetRows.Rows.Count
totalColumns = GetRows.Columns.count
response.write("Rows read again = " & totalRows & " columns = " &
totalColumns & "<br>")
for ktr = 0 to GetRows.Rows.Count - 1
response.write(GetRows.Rows(ktr)(1))
response.write( e.day.date)
if CDate(e.day.date) = _
CDate(GetRows(ktr)(1)) then
****************************************************************************
*******
Here is the error I get.
****************************************************************************
************
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: BC30367: Class 'System.Data.DataTable' cannot be
indexed because it has no default property.
Source Error:
Line 124: response.write( e.day.date)
Line 125: if CDate(e.day.date) = _
Line 126: CDate(GetRows(ktr)(1)) then
Line 127: response.write("Dates equal")
Line 128: else
****************************************************************************
*
Why cannot the GetRows Datatable not be indexed in the if statement, but it
works fine in the response.write?
Thanks,
Tom.
This statement apparently works fine:
response.write(GetRows.Rows(ktr)(1))
and this statement does not:
if e.day.date = GetRows(ktr)(1) then
Here is the snippet of code that has these statements
**********************************************************************
Dim GetRows as DataTable = sqlDS.tables("eventCalendar")
Dim totalRows as integer
Dim totalColumns as Integer
totalRows = GetRows.Rows.Count
totalColumns = GetRows.Columns.count
response.write("Rows read again = " & totalRows & " columns = " &
totalColumns & "<br>")
for ktr = 0 to GetRows.Rows.Count - 1
response.write(GetRows.Rows(ktr)(1))
response.write( e.day.date)
if CDate(e.day.date) = _
CDate(GetRows(ktr)(1)) then
****************************************************************************
*******
Here is the error I get.
****************************************************************************
************
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: BC30367: Class 'System.Data.DataTable' cannot be
indexed because it has no default property.
Source Error:
Line 124: response.write( e.day.date)
Line 125: if CDate(e.day.date) = _
Line 126: CDate(GetRows(ktr)(1)) then
Line 127: response.write("Dates equal")
Line 128: else
****************************************************************************
*
Why cannot the GetRows Datatable not be indexed in the if statement, but it
works fine in the response.write?
Thanks,
Tom.