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. Web Development
  3. ASP.NET
  4. unable to set connectionstring property of Sqldatasource dynamically

unable to set connectionstring property of Sqldatasource dynamically

Scheduled Pinned Locked Moved ASP.NET
csharpquestionasp-nettutorialworkspace
3 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.
  • Y Offline
    Y Offline
    yogita charhate
    wrote on last edited by
    #1

    unable to set connectionstring property of Sqldatasource used with gridView dynamically in asp.net 2.0 using c# after using it getting Exception :The connection name 'ConnectionString' was not found in the applications configuration or the connection string is empty. in syntax <%$ConnectionStrings:ConnectionString%> I'm thinking string after : is the key used in web.config file is it correct? Please guide what is gone wrong? following is the code snippet:

    yog hui gfgh kgdgrt njjn hjgkn

    S 1 Reply Last reply
    0
    • Y yogita charhate

      unable to set connectionstring property of Sqldatasource used with gridView dynamically in asp.net 2.0 using c# after using it getting Exception :The connection name 'ConnectionString' was not found in the applications configuration or the connection string is empty. in syntax <%$ConnectionStrings:ConnectionString%> I'm thinking string after : is the key used in web.config file is it correct? Please guide what is gone wrong? following is the code snippet:

      yog hui gfgh kgdgrt njjn hjgkn

      S Offline
      S Offline
      szukuro
      wrote on last edited by
      #2

      Does your web.config have a ConnectionString with the name 'ConnectionString'? Because the code you provided (though only visible in html source) assumes so.

      Y 1 Reply Last reply
      0
      • S szukuro

        Does your web.config have a ConnectionString with the name 'ConnectionString'? Because the code you provided (though only visible in html source) assumes so.

        Y Offline
        Y Offline
        yogita charhate
        wrote on last edited by
        #3

        thank you Szukuro for reply. Yes, web.config have a ConnectionString with the name 'ConnectionString' set as key name . now i tried with another syntax as follows in aspx page ConnectionString="ConnectionStrings:ConnectionString" This is not giving exception but dat is not getting bound to the repeater. Please guide. Thank you.

        yog hui gfgh kgdgrt njjn hjgkn

        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