Click here to Skip to main content
15,883,883 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir/Madam,
I am planning to import Excel 2007 data into my Database. As of initial work I am reading excel sheet data into DataTable using OleDbDataAdapter . But the problem is I am unable to read CheckBox controls data into my dataset. It is showing empty values for check box fields . I am sharing lines of code I am using.

DataTable dtTrainers;
dadVET = new OleDbDataAdapter("Select * From [SheetName$]", myConnection);
dtTrainers = new DataTable("TrainersAndAdminStaff");
dadVET.FillSchema(dtTrainers, SchemaType.Source);
dadVET.Fill(dtTrainers);

Please if you have any idea update solution asap.

Thanks & Regards,


T.Hari babu
E-Mail : tharibabu2@gmail.com
Posted
Comments
[no name] 28-Jun-13 2:09am    
it seems your excel sheet having some special property for that particular column(check box).Try to make this column Boolean .
Tiriveedhi Haribabu 3-Jul-13 23:24pm    
Thanks for the comment...I didn't find that property.. When i manually give true or false instead of check box I am able to export into dataset otherwise I am facing same issue empty value is coming in dataset. I am willing to share an image of that but here I didn't find attachments while replying to you.

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