Link to home
Start Free TrialLog in
Avatar of EE_Navigator
EE_Navigator

asked on

'System.Data.DataRowCollection.this[int]' has some invalid arguments

Hi
               i am facing a wonderful problem , i can't understand why this error

in my .aspx.cs file

OleDbDataAdapter adpTimeBar = new OleDbDataAdapter("select Emp_Name, Access_Date, Access_Time from Access_Reports ", _OleDbConnString); //_OleDbConnString is string varible used for connection string

        DataTable dtTimeBeta = new DataTable();
        adpTimeBar.Fill(dtTimeBeta);
DateTime AccessDate1 = new DateTime(0001, 01, 01, 00, 00, 00);
        DateTime AccessDate2 = new DateTime(0001, 01, 01, 00, 00, 00);

AccessDate2 = Convert.ToDateTime(dtTimeBeta.Rows[0]["Access_Date"]);
for (UInt32 i = 0; i < dtTimeBeta.Rows.Count; i++)
        {
            AccessDate1 = Convert.ToDateTime(dtTimeBeta.Rows[i]["Access_Date"]);// error is on this line    "System.Data.DataRowCollection.this[int]' has some invalid arguments"

Plese help me its urgent. Thanks in advance
Avatar of Pratima
Pratima
Flag of India image

for (UInt32 i = 0; i < dtTimeBeta.Rows.Count -1 ; i++)

use  dtTimeBeta.Rows.Count -1
Avatar of EE_Navigator
EE_Navigator

ASKER

Thanks for commenting..
but i am not i am not getting you the recomemned line by You is allready used
ASKER CERTIFIED SOLUTION
Avatar of EE_Navigator
EE_Navigator

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
oh yes , now no error. Thanks Pratima mcs..
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
why my first comment is not accepted ?