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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. y is it my connection could not be establish?

y is it my connection could not be establish?

Scheduled Pinned Locked Moved Visual Basic
debugginghelpquestion
6 Posts 3 Posters 1 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.
  • P Offline
    P Offline
    pandapatin
    wrote on last edited by
    #1

    Dim conMyData = New SqlConnection(ConfigurationManager.AppSettings("psmConnectionString")) cmdSelect = New SqlCommand("DBAuthenticate", conMyData) cmdSelect.CommandType = CommandType.StoredProcedure paramReturnValue = cmdSelect.Parameters.Add("RETURN_VALUE", SqlDbType.Int) paramReturnValue.Direction = ParameterDirection.ReturnValue cmdSelect.Parameters.AddWithValue("@NoPekerja", noPekerja) cmdSelect.Parameters.AddWithValue("@pWord", pWord) conMyData.open() there is my code.But it i try to debug it,the conMyData is not working? any help plizz.

    G 1 Reply Last reply
    0
    • P pandapatin

      Dim conMyData = New SqlConnection(ConfigurationManager.AppSettings("psmConnectionString")) cmdSelect = New SqlCommand("DBAuthenticate", conMyData) cmdSelect.CommandType = CommandType.StoredProcedure paramReturnValue = cmdSelect.Parameters.Add("RETURN_VALUE", SqlDbType.Int) paramReturnValue.Direction = ParameterDirection.ReturnValue cmdSelect.Parameters.AddWithValue("@NoPekerja", noPekerja) cmdSelect.Parameters.AddWithValue("@pWord", pWord) conMyData.open() there is my code.But it i try to debug it,the conMyData is not working? any help plizz.

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Standard question #1: What do you mean by "not working"? --- b { font-weight: normal; }

      P 1 Reply Last reply
      0
      • G Guffa

        Standard question #1: What do you mean by "not working"? --- b { font-weight: normal; }

        P Offline
        P Offline
        pandapatin
        wrote on last edited by
        #3

        when i try to run it exception apper.InvalidOperationException. it highlighted the conMydata.open() and said ==> The ConnectionString property has not been initialized. how could i solve it?

        G 1 Reply Last reply
        0
        • P pandapatin

          when i try to run it exception apper.InvalidOperationException. it highlighted the conMydata.open() and said ==> The ConnectionString property has not been initialized. how could i solve it?

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          You have forgotten to put the connection string in the configuration file. --- b { font-weight: normal; }

          P 1 Reply Last reply
          0
          • G Guffa

            You have forgotten to put the connection string in the configuration file. --- b { font-weight: normal; }

            P Offline
            P Offline
            pandapatin
            wrote on last edited by
            #5

            i've put the connection string in the webconfig file.but the same error still appear.Is there any place else should i put it?pliz man help me.how should i initialize the connection string?

            D 1 Reply Last reply
            0
            • P pandapatin

              i've put the connection string in the webconfig file.but the same error still appear.Is there any place else should i put it?pliz man help me.how should i initialize the connection string?

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Set a breakpoint on the line that grabs the connection string from the config file and VERIFY that it indeed does return what you think it does. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

              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