My winform resize when i open an OleDbConnection
-
i am using OleDbConnection to read excel files. excel file is read properly. but my form is resize and all text looks bigger and buggy when i open the connection. i really dont understand whats happend. please help me for this. thanks in advance.
DataTable sheet1 = new DataTable("Excel Sheet");
OleDbConnectionStringBuilder csbuilder = new OleDbConnectionStringBuilder();
csbuilder.Provider = "Microsoft.ACE.OLEDB.12.0";
csbuilder.DataSource = filename;
csbuilder.Add("Extended Properties", "Excel 12.0 Xml;HDR=YES");
string selectSql = @"SELECT * FROM [Sheet1$]";using (OleDbConnection connection = new OleDbConnection(csbuilder.ConnectionString)) using (OleDbDataAdapter adapter = new OleDbDataAdapter(selectSql, connection)) { connection.Open(); adapter.Fill(sheet1); connection.Close(); }
-
i am using OleDbConnection to read excel files. excel file is read properly. but my form is resize and all text looks bigger and buggy when i open the connection. i really dont understand whats happend. please help me for this. thanks in advance.
DataTable sheet1 = new DataTable("Excel Sheet");
OleDbConnectionStringBuilder csbuilder = new OleDbConnectionStringBuilder();
csbuilder.Provider = "Microsoft.ACE.OLEDB.12.0";
csbuilder.DataSource = filename;
csbuilder.Add("Extended Properties", "Excel 12.0 Xml;HDR=YES");
string selectSql = @"SELECT * FROM [Sheet1$]";using (OleDbConnection connection = new OleDbConnection(csbuilder.ConnectionString)) using (OleDbDataAdapter adapter = new OleDbDataAdapter(selectSql, connection)) { connection.Open(); adapter.Fill(sheet1); connection.Close(); }
Inherently, there's nothing in there that would cause the UI to resize. I assume, however, that there is a lot more to your code than this - what do you do with the DataTable? Is this being bound to something on the form?