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. Windows Forms
  4. "Application Error" on SQLConnection.Open(), following a FolderBrowserDialog.ShowDialog()

"Application Error" on SQLConnection.Open(), following a FolderBrowserDialog.ShowDialog()

Scheduled Pinned Locked Moved Windows Forms
helpcsharpdata-structuresdebuggingannouncement
6 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.
  • M Offline
    M Offline
    Member 3337485
    wrote on last edited by
    #1

    Hello, In my winapp targetting .Net FW v2.0.50727, a SQLConnection.Open() is done following FolderBrowserDialog.ShowDialog(). On the SQLConnection.Open(), I get the following error: "Error in the application" stack trace ================ at System.Threading.TimerBase.AddTimerNative(Object state, UInt32 dueTime, UInt32 period, StackCrawlMark& stackMark) at System.Threading.TimerBase.AddTimer(TimerCallback callback, Object state, UInt32 dueTime, UInt32 period, StackCrawlMark& stackMark) at System.Threading.Timer.TimerSetup(TimerCallback callback, Object state, UInt32 dueTime, UInt32 period, StackCrawlMark& stackMark) at System.Threading.Timer..ctor(TimerCallback callback, Object state, Int32 dueTime, Int32 period) at System.Data.ProviderBase.DbConnectionPool.CreateCleanupTimer() at System.Data.ProviderBase.DbConnectionPool.Startup() at System.Data.ProviderBase.DbConnectionPoolGroup.GetConnectionPool(DbConnectionFactory connectionFactory) at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPool(DbConnection owningObject, DbConnectionPoolGroup connectionPoolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at FolderBrowseAndSQLConnect.Form1.button2_Click(Object sender, EventArgs e) in E:\mybackup\FolderBrowseAndSQLConnect\FolderBrowseAndSQLConnect\Form1.cs:line 29 Please give suggestions to solve this problem. I run it on a "Win XP Professional SP3 Version 2002". Interestingly, this issue is not reproducible from other machines that have the same OS & .Net FW configuration. Thanks

    L 1 Reply Last reply
    0
    • M Member 3337485

      Hello, In my winapp targetting .Net FW v2.0.50727, a SQLConnection.Open() is done following FolderBrowserDialog.ShowDialog(). On the SQLConnection.Open(), I get the following error: "Error in the application" stack trace ================ at System.Threading.TimerBase.AddTimerNative(Object state, UInt32 dueTime, UInt32 period, StackCrawlMark& stackMark) at System.Threading.TimerBase.AddTimer(TimerCallback callback, Object state, UInt32 dueTime, UInt32 period, StackCrawlMark& stackMark) at System.Threading.Timer.TimerSetup(TimerCallback callback, Object state, UInt32 dueTime, UInt32 period, StackCrawlMark& stackMark) at System.Threading.Timer..ctor(TimerCallback callback, Object state, Int32 dueTime, Int32 period) at System.Data.ProviderBase.DbConnectionPool.CreateCleanupTimer() at System.Data.ProviderBase.DbConnectionPool.Startup() at System.Data.ProviderBase.DbConnectionPoolGroup.GetConnectionPool(DbConnectionFactory connectionFactory) at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPool(DbConnection owningObject, DbConnectionPoolGroup connectionPoolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at FolderBrowseAndSQLConnect.Form1.button2_Click(Object sender, EventArgs e) in E:\mybackup\FolderBrowseAndSQLConnect\FolderBrowseAndSQLConnect\Form1.cs:line 29 Please give suggestions to solve this problem. I run it on a "Win XP Professional SP3 Version 2002". Interestingly, this issue is not reproducible from other machines that have the same OS & .Net FW configuration. Thanks

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Can you post the code from Form1.button2_Click?

      I are Troll :suss:

      M 1 Reply Last reply
      0
      • L Lost User

        Can you post the code from Form1.button2_Click?

        I are Troll :suss:

        M Offline
        M Offline
        Member 3337485
        wrote on last edited by
        #3

        Sorry for the delay, here's the code: private void button2_Click(object sender, EventArgs e) { try { string connStr = ""; if (string.IsNullOrEmpty(txtUser.Text) && string.IsNullOrEmpty(txtPswd.Text)) connStr = String.Format("Data Source={0};Integrated Security=SSPI",txtSQLServer.Text); else connStr = String.Format("Data Source={0};user id={1};password={2}", txtSQLServer.Text,txtUser.Text,txtPswd.Text); SqlConnection sqlConn = new SqlConnection(connStr); sqlConn.Open(); MessageBox.Show("succesfully queried databases"); sqlConn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }

        L 1 Reply Last reply
        0
        • M Member 3337485

          Sorry for the delay, here's the code: private void button2_Click(object sender, EventArgs e) { try { string connStr = ""; if (string.IsNullOrEmpty(txtUser.Text) && string.IsNullOrEmpty(txtPswd.Text)) connStr = String.Format("Data Source={0};Integrated Security=SSPI",txtSQLServer.Text); else connStr = String.Format("Data Source={0};user id={1};password={2}", txtSQLServer.Text,txtUser.Text,txtPswd.Text); SqlConnection sqlConn = new SqlConnection(connStr); sqlConn.Open(); MessageBox.Show("succesfully queried databases"); sqlConn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          You're getting the Application Error on sqlConn.Open, and only on that specific machine? How does the connection-string look when you debug the application?

          I are Troll :suss:

          M 1 Reply Last reply
          0
          • L Lost User

            You're getting the Application Error on sqlConn.Open, and only on that specific machine? How does the connection-string look when you debug the application?

            I are Troll :suss:

            M Offline
            M Offline
            Member 3337485
            wrote on last edited by
            #5

            Answer to Q#1.1: Yes the application error is on sqlConn.Open. Answer to Q#1.2: Yes, this is reproducible only on some machines. Answer to Q#2: connection string looks like this - "Data Source=computer-88\\sqlexpress;Integrated Security=SSPI"

            L 1 Reply Last reply
            0
            • M Member 3337485

              Answer to Q#1.1: Yes the application error is on sqlConn.Open. Answer to Q#1.2: Yes, this is reproducible only on some machines. Answer to Q#2: connection string looks like this - "Data Source=computer-88\\sqlexpress;Integrated Security=SSPI"

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Looks good, doesn't seem to be a problem with the code. It was on a specific machine? Could there be another application running that's using the same port as SQL Express? You might want to try to connect over IP, using the default port-settings. If it helps, we'll have a clue where to look next :)

              I are Troll :suss:

              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