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. Connecting to data base

Connecting to data base

Scheduled Pinned Locked Moved ASP.NET
databasesecurity
3 Posts 3 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.
  • S Offline
    S Offline
    Saba02
    wrote on last edited by
    #1

    hello, i have this coonectio string in my web.config. <connectionStrings> <add name="ShoppingConnectionString2" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Inetpub\wwwroot\myonlineshopping01\App_Data\MyOnlineShopping.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient" /> and my page.aspx.cs is this: <code>SqlConnection MyConn = new SqlConnection(ConfigurationManager.ConnectionStrings["ShoppingConnectionString2"].ConnectionString);</code>; but i could not connect to database, is this codes result of that i can't connect. thank you,

    Hoda

    C V 2 Replies Last reply
    0
    • S Saba02

      hello, i have this coonectio string in my web.config. <connectionStrings> <add name="ShoppingConnectionString2" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Inetpub\wwwroot\myonlineshopping01\App_Data\MyOnlineShopping.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient" /> and my page.aspx.cs is this: <code>SqlConnection MyConn = new SqlConnection(ConfigurationManager.ConnectionStrings["ShoppingConnectionString2"].ConnectionString);</code>; but i could not connect to database, is this codes result of that i can't connect. thank you,

      Hoda

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Saba02 wrote:

      but i could not connect to database,

      *sigh* I'm going to ask some obvious questions that we shouldn't really need to ask. I mean really, do you go to your doctor and say "I'm ill! is my diet the problem?" with out giving any other information? So, what was the error message? If there was no error message what did it do instead of connecting to the datbase? Have you checked that the connection string is actually correct for the database?

      Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) - (part 3) My website | Blog

      1 Reply Last reply
      0
      • S Saba02

        hello, i have this coonectio string in my web.config. <connectionStrings> <add name="ShoppingConnectionString2" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Inetpub\wwwroot\myonlineshopping01\App_Data\MyOnlineShopping.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient" /> and my page.aspx.cs is this: <code>SqlConnection MyConn = new SqlConnection(ConfigurationManager.ConnectionStrings["ShoppingConnectionString2"].ConnectionString);</code>; but i could not connect to database, is this codes result of that i can't connect. thank you,

        Hoda

        V Offline
        V Offline
        Vasudevan Deepak Kumar
        wrote on last edited by
        #3

        Saba02 wrote:

        i can't connect

        You ought to be more clear in what you are encountering (the exact error message which you are getting) while attempting to connect to the data source.

        Vasudevan Deepak Kumar Personal Homepage
        Tech Gossips
        A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

        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