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. how to acces appsetting web.config for connection string?

how to acces appsetting web.config for connection string?

Scheduled Pinned Locked Moved Visual Basic
databasehelptutorialquestion
4 Posts 2 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

    the erro: Format of the initialization string does not conform to specification starting at index 0. "Dim Myconn As New SqlClient.SqlConnection("ConnectionString2")" this is the problem line.

    G 1 Reply Last reply
    0
    • P pandapatin

      the erro: Format of the initialization string does not conform to specification starting at index 0. "Dim Myconn As New SqlClient.SqlConnection("ConnectionString2")" this is the problem line.

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

      The connection object will not read the value from the config file, you have to do that yourself and pass the value to the connection object. --- b { font-weight: normal; }

      P 1 Reply Last reply
      0
      • G Guffa

        The connection object will not read the value from the config file, you have to do that yourself and pass the value to the connection object. --- b { font-weight: normal; }

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

        how can i do that?can u show me an example.

        G 1 Reply Last reply
        0
        • P pandapatin

          how can i do that?can u show me an example.

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

          Example from MSDN:

          Public Sub ReadMyAppSettings()
          Dim appName As String
          appName = ConfigurationSettings.AppSettings("Application Name")
          Console.WriteLine()
          Console.WriteLine("Reading AppSettings")
          Console.WriteLine("Application Name: " & appName)
          End Sub

          The ConfigurationSettings class is in the System.Configuration namespace. --- b { font-weight: normal; }

          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