Click here to Skip to main content
15,921,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I am reading values in a dataset from a excelsheet through OLEDBDataAdapter and than adding them to a gridview through a datatable.

let say those values are in two columns and when i see at the datatable before binding to gridview, it is showing exact two columns and proper data.

But if i try to check the gridview data in Gridview's "OnRowDatabound" event, it shows that only one cell is there... and if i try to get the values through

than it gives me error,

Any idea???
thatraja 8-Oct-13 8:02am    
what's the error message? :'(
update your question with more code
Azee 8-Oct-13 8:02am    
Have you configured the GridView to show two columns?
VICK 8-Oct-13 8:17am    
Azee, you came a bit late.. anyways You got it right... :)
Madhu Nair 8-Oct-13 8:04am    
Post your code for binding the gridivew

1 solution

Problem was the absense of bound fields, as I was binding the Gridview directly with datatable, so it was showing the values in the Gridview,

But was not getting them as row value's because there was no physical row available in the gridview,

So I added two bound fields, binded them with the gained valued in datatable, and than here I am, easily getting row cells valus,

Thanks to all for help... :)
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900