Thursday, December 22, 2011

How To - Get connection string from web.config in ASP.NET

Sample web.config



  
  


Get Connection string at runtime

In order to retrieve a specific connection string from the web.config, first we need a reference to System.Configuration. In .NET 4, the reference has already been added for us, but we still need to add "using System.Configuration;" in our page. In previous .NET versions, you needed to add the reference manually by going to the references folder in the solution explorer, right click and select Add Reference. From the .NET tab, select System.Configuration. After having done the above, we can get the connection string required by using the following code.
private const string CONNECTIONSTRING_NAME = "LocalSqlServer";
string myConnectionString = ConfigurationManager.ConnectionStrings[CONNECTIONSTRING_NAME].ConnectionString;

Using connection string expression syntax

We can bind the connection string directly to the connection string property of the sqldatasource using ASP.NET expressions. This is done by using the following syntax




109 comments:

  1. Anger is an acid that can do more harm to the vessel in which it is stored than to anything on which it is poured. See the link below for more info.

    anger @
    www.inspgift.com



    ReplyDelete
  2. Thanks for penning high-grade contents what you actually
    share here is valuable and remarkable for revisiting looking forward for the
    next write-up.

    www.joeydavila.net

    ReplyDelete
  3. I really enjoyed reading your article. I found this as an informative and interesting post, so i think it is very useful and knowledgeable. I would like to thank you for the effort you have made in writing this article.


    edupdf.org

    ReplyDelete
  4. Those look interesting. Keep posting.

    chester
    www.imarksweb.org

    ReplyDelete
  5. Hi i have found such great blog here i hope it will helpful for you thanks for sharing.
    greengeeks coupon

    ReplyDelete
  6. The scores could additionally affect the circulation of newsfeed and also chart search which is a new element for marketing experts to think about. Where To Buy Pinterest Followers

    ReplyDelete
  7. Get a wide range of packing and moving companies at helloenquiry.in. We endeavour to furnish the best packers and movers companies in your city at ease of Internet. Packers and Movers Bangalore

    ReplyDelete
  8. I really enjoyed reading your blog, you have lots of great content.Please visit here:
    http://packersmoversahmedabad.co.in/
    Ahmedabad Packers And Movers is recognized as a business manager providing wide-ranging and differentiate service appearance as well as Relocation Shifting, Logistics and Transportation, Facilities managing, strategy & Designing services.

    ReplyDelete
  9. Packers Movers Bangalore amenable and kind administration individual take care of customer's enthusiasm for pressing and transporting and give them as per their bolster and hobby. This is for to meet their individual requests as every one have an alternate safe place. With the yearning to be "THE BEST" Packers Movers Bangalore productively constant frequently work to keep up the tag. What's more, henceforth ruling out grumblings.
    http://packersmoversbangalore.in/packers-and-movers-ahmedabad
    http://packersmoversbangalore.in/packers-and-movers-hyderabad
    http://blog.packersmoversbangalore.in/

    ReplyDelete
  10. People have to sustain their kitchen position place position items more purposely, since it allows them a lot for cooking and providing the foods so they should adhere to the several factors while cleaning and cleaning the factors. Packers and Movers in Bangalore
    Packers and Movers in Pune
    Packers and Movers in Hyderabad
    Packers and Movers in Mumbai

    ReplyDelete
  11. Extreme attention must be put towards the cleaning of the desk ware places and after cleaning, it has to be desiccated. Packers and Movers in Chennai
    Packers and Movers in Delhi
    Packers and Movers in Gurgaon
    Packers and Movers in Noida

    ReplyDelete
  12. I must say you had done a tremendous job,I appreciate all your efforts.Thanks alot for your writings......Waiting for a new 1...Please visit our wonderful and valuable website-http://packersmovershyderabadcity.in/
    http://blog.packersmovershyderabadcity.in/
    http://packersmovershyderabadcity.in/packers-and-movers-anantapur
    http://packersmovershyderabadcity.in/packers-and-movers-vizianagaram

    ReplyDelete
  13. Packers and Movers Delhi look for mixed bag of packers and movers according to your necessity, who are pre-screened prepared individuals and affirm to satisfy every one of your requests progressively at amazingly moderate cost . You're ready to assess their expenses and pick an association fundamentally in light of your requests. These organizations guarantee you with administrations like local moving, some chose products like huge contraptions or auto/bicycle exchange, business/office/shop place movement, pre-protection administrations for merchandise moved by us if there should be an occurrence of any harm happen by us. Our administrations are for client's advantage and certification on us just which is principle variable of their fascination and on enlisting us and making us no. one online organization.
    http://packers-and-movers-delhi.in/
    http://packers-and-movers-delhi.in/packers-and-movers-gym-khana-club-delhi

    ReplyDelete
  14. Generally I don’t read article on blogs, but I would like to say that this write-up very compelled me to take
    a look at and do so! Your writing style has been amazed me.
    Thank you, very great post.
    Please visit our wonderful and valuable website-
    http://packersmoverschennai.in/
    http://packersmoverschennai.in/packers-and-movers-indian-institute-of-technology-chennai

    ReplyDelete
  15. Thanks you for sharing this informative and useful article.Really interesting and awesome article.
    Please Visit Our Webpage: http://packersmoversahmedabad.co.in/
    http://packersmoversahmedabad.co.in/packers-and-movers-jamnagar-gujarat
    http://packersmoversahmedabad.co.in/packers-and-movers-kutch-gujarat
    http://packersmoversahmedabad.co.in/packers-and-movers-mehsana-gujarat
    We are expert in Handling, Movers Packers in Ahmedabad and Packing & Shifting of Household Goods, Office goods, Commercial Equipment and Car, Logistics and Transportation. Packers And Movers Ahmedabad

    ReplyDelete
  16. I appreciate from this post and its seems looking so informative ad networks for good target for Indian's. Thanks for sharing with us..
    Packers And Movers Bangalore
    Packers And Movers in Bangalore

    ReplyDelete
  17. Packers and Movers Delhi designate you a simple of covering the administrations like family/private moving, office exchanging, products moving , stacking and emptying, and so on most importantly if there should arise an occurrence of delay additionally we give you the office of warehousing your extensive measure of merchandise. Whether deferral is from your side or from our side or because of any normal catastrophe we are in charge of the wellbeing and security of your profitable stock for a week prior and then afterward the enrolled dates of migration to us.
    http://packers-and-movers-delhi.in/
    http://packers-and-movers-delhi.in/packers-and-movers-patel-nagar-delhi

    ReplyDelete
  18. Packers and Movers Kolkata list up the leading #packers and #Movers Company for you to choose best among reputed companies in moving industry. They offer Packers And Movers services Kolkata at your doorstep helping you with shifting #household items, #office relocation, furniture, machinery and equipment, industrial goods, etc. Besides shipping of household goods, Packers And Movers in Kolkata provide modern facilities like warehouse shifting. Our experienced and skilled professional labors are trained to expertise the shifting process without any disturbance and inconvenience to the customer. So as to make their shifting hassle free.
    http://blog.kolkatapackersmovers.in/
    http://kolkatapackersmovers.in/packers-and-movers-customs-house-kolkata

    ReplyDelete
  19. hey,nice blog i must say u had done a tremendous job here thanks for all the efforts you made.
    Please visit our official website for necessary information we provided-http://packersmoverschennai.in/
    http://packersmoverschennai.in/sitemap
    Packers And Movers Chennai

    ReplyDelete
  20. Get a wide range of packing and moving companies at helloenquiry.in. We endeavour to furnish the best packers and movers companies in Gandhinagar at ease of Internet. Packers and Movers Gandhinagar

    ReplyDelete
  21. MOVERS AND PACKERS IN BANGALORE regard your sentiments and know the feelings of yours associated with the advantages thus to ensure the well-being and security of your associations is our uttermost need. Therefore we list only the skilled and sound departure workplaces with us. Our organizations are not compelled here just, we outfit you with the free question shape so you can get free relocation refers to from the top packers and movers of your city with a single structure. This is the thing that we and our working methodologies is about, your convenience and your satisfaction.
    http://packers-and-movers-bangalore.in/

    ReplyDelete
  22. Izin share ya, semoga sukses:
    http://obatglaukoma.utamakansehat.com/
    http://obatnyerisendi.utamakansehat.com/
    http://obattbckelenjar1.utamakansehat.com/
    http://obatkuatbercinta.greenworldglobals.com/
    http://obatamandel.utamakansehat.com/
    http://pengobatandarahtinggi.greenworldglobals.com/
    http://obatususbuntu.utamakansehat.com/
    http://obathernia.utamakansehat.com/

    ReplyDelete
  23. Thanks for sharing useful information for us.I really enjoyed reading your blog, you have lots of great content.Please visit here:
    http://packersmovershyderabadcity.in/
    Hyderabad Packers And Movers is recognized as a business manager providing wide-ranging and differentiate service appearance as well as Relocation Shifting, Logistics and Transportation, Facilities managing, strategy & Designing services.thanks a lot for all your efforts...
    Packers And Movers Hyderabad

    ReplyDelete
  24. Thanks for sharing useful information for us.I really enjoyed reading your blog, you have lots of great content.Please visit here:
    http://packersmovershyderabadcity.in/
    Hyderabad Packers And Movers is recognized as a business manager providing wide-ranging and differentiate service appearance as well as Relocation Shifting, Logistics and Transportation, Facilities managing, strategy & Designing services.thanks a lot for all your efforts...
    Packers And Movers Hyderabad

    ReplyDelete
  25. I really enjoyed reading your blog, you have lots of great content.Please visit here:
    http://jaipurpackersandmovers.in/
    http://jaipurpackersandmovers.in/packers-and-movers-alwar
    We are expert in Handling, Movers And Packers Jaipur and Packing & Shifting of Household Goods, Office goods, Commercial Equipment and Car, Logistics and Transportation.

    ReplyDelete
  26. I really enjoyed reading your blog, you have lots of great content.Please visit here:
    http://packersmoversmumbaicity.in/
    Packers And Movers is recognized as a business manager providing wide-ranging and differentiate service appearance as well as Relocation Shifting, Logistics and Transportation, Facilities managing, strategy & Designing services.

    ReplyDelete
  27. Thanks for sharing useful information for us.I really enjoyed reading your blog, you have lots of great content.Please visit here:
    http://bhubaneswarpackersmovers.in/
    Packers And Movers Bhubaneswar based company provided that Movers And Packers Bhubaneswar Services for Office, Home, Local or domestic and commercial purposes.

    ReplyDelete
  28. An excellent information provided thanks for all the information i must say great efforts made by you.
    thanks a lot for all the information you provided.
    please visit our official website for further details-
    http://kolkatapackersmovers.in/
    http://kolkatapackersmovers.in/packers-and-movers-hooghly

    ReplyDelete
  29. Hello sir your article or work is so nice and full informative with each and singal point and i loved to reading that kind article which is available in your website so thanks and yes keep updating more stuff on this topic. Below check some stuff,
    Happy Holi 2016 Images ,
    Happy Holi 2016 Sms ,
    Happy Holi 2016 Messages ,
    Holi Images Pictures for Facebook and Whatsapp Status ,
    Holi 2016 Photos Images ,
    Happy Holi 2016 Wallpapers ,
    Happy Holi 2016 Pictures Greeting
    Happy Holi 2016

    ReplyDelete
  30. Packers And Movers Bhopal i must say you had done a tremendous job,I appreciate all your efforts.Thanks alot for your writings......Waiting for a new 1..
    http://packersmoversbhopal.in/packers-and-movers-indore

    ReplyDelete
  31. You have well written post, I search through the search engine and found your blog. You have good skill of writing, sure I will keep stay tune with your next post. Visit my travel blog
    Packers And Movers Bangalore
    http://packers-and-movers-bangalore.in/packers-and-movers-horamavu-bengaluru
    http://packers-and-movers-bangalore.in/packers-and-movers-hennagara-bengaluru
    http://packers-and-movers-bangalore.in/packers-and-movers-hampinagar-bengaluru
    Packers and Movers Bangalore provide you best services for transporting your goods and vehicles to your new place. We handle it with best care.

    ReplyDelete
  32. Our organization that offers professional Packing and Moving services Visit
    http://www.expert5th.in/packers-and-movers-jaipur/
    http://www.expert5th.in/packers-and-movers-amritsar/
    http://www.expert5th.in/packers-and-movers-dehradun/
    http://www.expert5th.in/packers-and-movers-haridwar/
    http://www.expert5th.in/packers-and-movers-rishikesh/
    http://www.expert5th.in/packers-and-movers-ludhiana/
    http://www.expert5th.in/packers-and-movers-jalandhar/
    http://www.expert5th.in/packers-and-movers-panchkula/
    http://www.expert5th.in/packers-and-movers-ghaziabad/
    http://www.expert5th.in/packers-and-movers-faridabad/
    http://www.expert5th.in/packers-and-movers-jammu/
    http://www.expert5th.in/packers-and-movers-rudrapur/
    http://www.expert5th.in/packers-and-movers-shimla/

    ReplyDelete
  33. If you are looking Best Packers and Movers so Just Visit
    http://www.expert5th.in/packers-and-movers-kullu/
    http://www.expert5th.in/packers-and-movers-mohali/
    http://www.expert5th.in/packers-and-movers-karnal/
    http://www.expert5th.in/packers-and-movers-ambala/
    http://www.expert5th.in/packers-and-movers-nagpur/
    http://www.expert5th.in/packers-and-movers-kota/
    http://www.expert5th.in/packers-and-movers-chandigarh/
    http://www.expert5th.in/packers-and-movers-bhopal/
    http://www.expert5th.in/packers-and-movers-raipur/
    http://www.expert5th.in/packers-and-movers-indore/
    http://www.expert5th.in/packers-and-movers-kolkata/
    http://www.expert5th.in/packers-and-movers-ahmedabad/
    http://www.expert5th.in/packers-and-movers-rohtak/

    ReplyDelete
  34. To get best Packing and Shifting service at affordable price Visit
    http://www.expert5th.in/packers-and-movers-manesar/
    http://www.expert5th.in/packers-and-movers-agra/
    http://www.expert5th.in/packers-and-movers-bhatinda/
    http://www.expert5th.in/packers-and-movers-bikaner/
    http://www.expert5th.in/packers-and-movers-pathankot/
    http://www.expert5th.in/packers-and-movers-hisar/
    http://www.expert5th.in/packers-and-movers-panipat/
    http://www.expert5th.in/packers-and-movers-sonipat/
    http://www.expert5th.in/packers-and-movers-rajkot/
    http://www.expert5th.in/packers-and-movers-surat/
    http://www.expert5th.in/packers-and-movers-vadodara/
    http://www.expert5th.in/packers-and-movers-kurukshetra/
    http://www.expert5th.in/packers-and-movers-jamnagar/
    http://www.expert5th.in/packers-and-movers-varanasi/

    ReplyDelete
  35. Nice blog i must say u had done a tremendous job here thanks for all the efforts you made.
    Please visit our official website for necessary information we provided-
    http://kolkatapackersmovers.in/
    http://kolkatapackersmovers.in/packers-and-movers-midnapore
    http://kolkatapackersmovers.in/packers-and-movers-jalpaiguri

    ReplyDelete
  36. Your website content is fabulous and awesome but I would like to say your website also good.
    Thanks for sharing... Keep it up..
    http://packersmoverschennai.in/packers-and-movers-tuticorin-thoothukudi-tamilnadu
    http://packersmoverschennai.in/packers-and-movers-tuticorin-thoothukudi-tamilnadu
    http://packersmoverschennai.in/packers-and-movers-tiruchirappalli-tamilnadu
    With the many years of experience in supporting people with this requirements and colossal assortment of packers and movers organizations Chennai, we require push to invest you with the better choices. In this way, how about we come us and get help with the best help.
    Packers And Movers Chennai

    ReplyDelete
  37. Best packers and movers in Ahmedabad, household shifting service in Ahmedabad, home relocation in Ahmedabad, car carriers service in Ahmedabad, car transport in Ahmedabad. packers and movers Ahmedabad

    ReplyDelete
    Replies
    1. Thanks you for this article. Really interesting and awesome article.

      MERA GHAR PACKERS AND MOVERS
      225/2B, Upendranath Banerjee Road, Behala, Parnasree, Kolkata, West Bengal 700060
      Phone: 9830233978
      Web: http://www.packers-and-movers-kolkata.in
      https://plus.google.com/+MeraGharPackersAndMoversKolkata
      http://www.packers-and-movers-kolkata.in/packers-and-movers-kasba.html
      http://www.packers-and-movers-kolkata.in/packers-and-movers-newalipore.html
      http://www.packers-and-movers-kolkata.in/packersandmoversnewtown.html
      http://www.packers-and-movers-kolkata.in/packers-and-movers-in-behala.html
      http://www.packers-and-movers-kolkata.in/movers-and-packers-kolkata-garia.html
      http://www.packers-and-movers-kolkata.in/packers-and-movers-durgapur.html
      http://www.packers-and-movers-kolkata.in/packers-and-movers-jadavpur.html

      Delete
  38. Start your day positively and the rest will follow. Please do visit my site.Thank you and have a good day.

    triciajoy.com

    www.triciajoy.com

    ReplyDelete
  39. Really impressive post. I read it whole and going to share it with my social circules. I enjoyed your article and planning to rewrite it on my own blog.
    Packers And Movers Bangalore

    Packers And Movers in Bangalore

    ReplyDelete
  40. After apply the ESTA VISA ,then you get the authorization status.Then you must click the “Next” after getting your ESTA VISA application number.After completing the

    registration process it will provide only the notification.If your received the approval you need to printout or write down the ESTA VISA application number for checking of the ESTA status.In ESTA VISA Application has the three types of response there are Authoriztion Approved,Authorization Pending and Travel Not Authorized.Candidates who are receiving the ESTA Authorization Pending response need to check the websites updates within 72 hours will receive the final response.

    ReplyDelete
  41. I admire the valuable advice you make available in your expertly written content. I want to thank you for this informative read; I really appreciate sharing this great.
    Packers And Movers Pune
    Packers And Movers Nigdi Pune
    Packers And Movers Chinchwad Pune

    ReplyDelete
  42. Packers and Movers in Gurgaon
    Packers and Movers in Mumbai
    We are providing you free Relocation from up to top 5 packers and movers companies of this city. Make sure you will hire the one that will perfectly, flawlessly and nicely cater to all you’re moving, shifting and relocation needs at the budget you have planned for your movement.

    Packers and Movers in Pune
    Packers and Movers in Bangalore
    Packers and Movers in Mumbai

    ReplyDelete
  43. Your website content is fabulous and awesome but I would like to say your website also good. Thanks for sharing... Keep it up..
    http://packersmovers.top/chennai/
    http://packersmoverschennai.in/
    Packers And Movers Pudukkottai Tamilnadu
    Packers And Movers Ramanathapuram Tamilnadu
    Packers And Movers Salem Tamilnadu
    Packers And Movers Sivaganga Tamilnadu

    ReplyDelete
  44. Design of data your shared is pretty simple and a decent easy to understand interface. Experience is essential in each industry. We have great involvement in packing, shifting and moving the merchandise according to our client's craving and needs. Packers And Movers Bangalore
    Packers And Movers Hampinagar
    Packers And Movers JP Nagar
    Packers And Movers Doddakallasandra

    ReplyDelete
  45. You’ve written nice post, I am gonna bookmark this page, thanks for info. I actually appreciate your own position and I will be sure to come back here.
    Signature:
    happy wheels
    friv
    girlsgogames
    games2girls
    happy wheels

    ReplyDelete
  46. manufactured by RDK Global.The average person taking Phen375 once a day loses 3-5 pounds in a single week.That’s over a pound every 48 hours! Another Phen375 advantage is that it does not stop its action after 3 months. You may take it as long as you need it.For More Information Visit: http://www.dietreviewmonster.com/phen375

    ReplyDelete
  47. Thanks for providing such a helpful information
    Very nice I like a lot of these topics, it was part of my area.

    Packers Movers Indore
    Packers And Movers Bhanwrasala Indore
    Packers And Movers Bhatkhedi Indore

    ReplyDelete
  48. This content is written very well. Your use of formatting when making your points makes your observations very clear and easy to understand. Thank you.
    - usps tracking
    - iphone 7 release date
    - netflix

    ReplyDelete
  49. An excellent information provided thanks for all the information i must say great efforts made by you.
    thanks a lot for all the information you provided.
    please visit our official website for further details-
    Packers And Movers Jaipur

    ReplyDelete
  50. http://greencoffeebeanmaxorder.com/
    Learn How Green Coffee Bean Max Extract can help slimmers lose excess body fat in a healthy and quick way without any negative side effects and buy online.

    ReplyDelete
  51. DO NOT BUY PHEN375 Until You Read This Review! Check Out Side Effects, User Feedback and customer reviews! http://www.phen375online2016.com/

    ReplyDelete
  52. I must say you had done a tremendous job,I appreciate all your efforts.Thanks alot for your writings......Waiting for a new 1.. We Provide Best Packers And Movers Bangalore List for Get Free Best Quotes, Compare Charges, Save Money And Time,
    Household Shifting Services. @ Packers And Movers in Bangalore

    ReplyDelete
  53. Thanks for sharing. I hope it will be helpful for too many people that are searching for this topic.
    Movers and Packers Delhi
    Movers and Packers Gurgaon
    Movers and Packers Mumbai

    ReplyDelete
  54. I enjoy most of your articles,the articles are so nice for readers.

    www.gofastek.com

    ReplyDelete
  55. Looking for proven, effective Dianabol for Sale without side effects? Discover premium Dbal-Max Pills currently helping guys build mass safely. http://www.dbalmax-reviews.com/

    ReplyDelete
  56. Breast Actives
    is a 3 step all natural solution for breast enlargement, combining breast pills, cream and a breast exercise and massage program.http://www.breastactivesbuy.com/

    ReplyDelete
  57. The blog or and best that is extremely useful to keep I can share the ideas. Age Of War 2
    Big Farm | Slitherio | Tank Trouble
    Of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much.
    Happy Wheels | Goodgeme Empire | Slither.io

    ReplyDelete
  58. This information must read once by each and everyone because its essential for all.
    thanks admin for your updated and very nice post always.
    Download CinemaBox

    ReplyDelete
  59. I am very glad to share this information. This will helps many others. It helps me in my trouble to shift my stuff, and finally I move it with shiftinggude’s services. Thanx shiftingguide.
    packers and movers delhi
    packers and movers gurgaon

    ReplyDelete
  60. There are many low standards and inexperience shifting are also available in few costs which is not perfect for people who want to shift in Delhi or across the country. You have to avoid the inexperience moving companies for better stuffs and easier and smooth relocation from one place to another place
    Packers and Movers in Delhi
    Movers and Packers in Delhi
    Packers and Movers Delhi
    Movers and Packers Delhi

    ReplyDelete