Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. My winform resize when i open an OleDbConnection

My winform resize when i open an OleDbConnection

Scheduled Pinned Locked Moved C#
xmlhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Le rner
    wrote on last edited by
    #1

    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();
    
                    
                }
    
    P 1 Reply Last reply
    0
    • L Le rner

      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();
      
                      
                  }
      
      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      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?

      Advanced TypeScript Programming Projects

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups