c# - windows form design Ruined when connect to excel -
when connect excel file code (exactly when _conn.open();)
_conn = new oledbconnection(_connectionstrting); _conn.open(); datatable dt = _conn.getoledbschematable(oledbschemaguid.tables, null); string[] sheetnames = new string[dt.rows.count]; int = 0; foreach (datarow row in dt.rows) { sheetnames[i] = row["table_name"].tostring(); combobox2.items.add(sheetnames[i]); i++; } _conn.close();
my windows form design(in c#) gets problems resolution changes , element size getting smaller before , place of elements changes in run time .i use other way connect excel(using excel library) , don't have problem.but curious problem.can 1 told me why happen?
this bug has haunted many developers!
a user posted example on youtube here: https://www.youtube.com/watch?v=zdby6gmbx_4
solution: if uninstall "microsoft access database engine 2010 redistributable" 32 bit version , install 64 bit version. uninstall 64 bit version , reinstall 32 bit version work
Comments
Post a Comment