A
andrew
I have a db with 4 fields (id,field1, field2,field3).
I populate a datareader (named dr) with this sql
select * from table where id=2
Now i want to pre-set a textbox with the info in field1.
Seems like this should work
TextBox5.text=dr("field1")
i keep getting this error
Exception Details: System.InvalidOperationException:
Invalid attempt to read when no data is present.
So the first assumption is i've selected a row that
doesn't exist or that has no info in field1 BUT if i bind
the datareader to a datagrid i see the following info
id field1 field2 field3
2 sdf dgfsdg Choose
where isn't my reference working?
I populate a datareader (named dr) with this sql
select * from table where id=2
Now i want to pre-set a textbox with the info in field1.
Seems like this should work
TextBox5.text=dr("field1")
i keep getting this error
Exception Details: System.InvalidOperationException:
Invalid attempt to read when no data is present.
So the first assumption is i've selected a row that
doesn't exist or that has no info in field1 BUT if i bind
the datareader to a datagrid i see the following info
id field1 field2 field3
2 sdf dgfsdg Choose
where isn't my reference working?