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. Database & SysAdmin
  3. Database
  4. Regaring Establishing Connection with sqlserver.

Regaring Establishing Connection with sqlserver.

Scheduled Pinned Locked Moved Database
databasesql-serversysadminsecurityhelp
4 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.
  • D Offline
    D Offline
    dayakar_dn
    wrote on last edited by
    #1

    Hi All, I am getting a strange error while establishing connection with sqlserver. i written the following code to establish the connection string sqlStatement = "select * from Student_Table"; String dataBaseConnection = "Data Source=DREDDY9/SQLEXPRESS;Initial Catalog=SampleDataBase;Integrated Security=SSPI"; SqlConnection myConnection = new SqlConnection(dataBaseConnection); SqlCommand myCommand = new SqlCommand(sqlStatement, myConnection); SqlDataReader dr; myConnection.Open(); dr = myCommand.ExecuteReader(); if(dr!=null) { Response.Write("Successfully Executed"); } myConnection.Close(); To resolve this i tried with enabling local and remote connections and i enabled sql server browser. but no use any body is having any solution. please shere it.

    D I 3 Replies Last reply
    0
    • D dayakar_dn

      Hi All, I am getting a strange error while establishing connection with sqlserver. i written the following code to establish the connection string sqlStatement = "select * from Student_Table"; String dataBaseConnection = "Data Source=DREDDY9/SQLEXPRESS;Initial Catalog=SampleDataBase;Integrated Security=SSPI"; SqlConnection myConnection = new SqlConnection(dataBaseConnection); SqlCommand myCommand = new SqlCommand(sqlStatement, myConnection); SqlDataReader dr; myConnection.Open(); dr = myCommand.ExecuteReader(); if(dr!=null) { Response.Write("Successfully Executed"); } myConnection.Close(); To resolve this i tried with enabling local and remote connections and i enabled sql server browser. but no use any body is having any solution. please shere it.

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      What is the error?

      It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

      1 Reply Last reply
      0
      • D dayakar_dn

        Hi All, I am getting a strange error while establishing connection with sqlserver. i written the following code to establish the connection string sqlStatement = "select * from Student_Table"; String dataBaseConnection = "Data Source=DREDDY9/SQLEXPRESS;Initial Catalog=SampleDataBase;Integrated Security=SSPI"; SqlConnection myConnection = new SqlConnection(dataBaseConnection); SqlCommand myCommand = new SqlCommand(sqlStatement, myConnection); SqlDataReader dr; myConnection.Open(); dr = myCommand.ExecuteReader(); if(dr!=null) { Response.Write("Successfully Executed"); } myConnection.Close(); To resolve this i tried with enabling local and remote connections and i enabled sql server browser. but no use any body is having any solution. please shere it.

        I Offline
        I Offline
        i i i
        wrote on last edited by
        #3

        what kind of error you are facing are you enable to connect if so then try

        Data Source=./SQLEXPRESS instead off Data Source=DREDDY9/SQLEXPRESS

        also check your protocols you are connecting with tcp/ip or named pipes and the user from which you are going to connect should have rights to connect to the db.

        Best Of Regards, SOFTDEV If you have knowledge, let others light their candles at it

        1 Reply Last reply
        0
        • D dayakar_dn

          Hi All, I am getting a strange error while establishing connection with sqlserver. i written the following code to establish the connection string sqlStatement = "select * from Student_Table"; String dataBaseConnection = "Data Source=DREDDY9/SQLEXPRESS;Initial Catalog=SampleDataBase;Integrated Security=SSPI"; SqlConnection myConnection = new SqlConnection(dataBaseConnection); SqlCommand myCommand = new SqlCommand(sqlStatement, myConnection); SqlDataReader dr; myConnection.Open(); dr = myCommand.ExecuteReader(); if(dr!=null) { Response.Write("Successfully Executed"); } myConnection.Close(); To resolve this i tried with enabling local and remote connections and i enabled sql server browser. but no use any body is having any solution. please shere it.

          I Offline
          I Offline
          i i i
          wrote on last edited by
          #4

          look out for slash it should be \ not / Data Source=DREDDY9/SQLEXPRESS; Data Source=DREDDY9**\**SQLEXPRESS; :doh:

          Best Of Regards, SOFTDEV If you have knowledge, let others light their candles at it

          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