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. General Programming
  3. C#
  4. database connection without a datasource

database connection without a datasource

Scheduled Pinned Locked Moved C#
databasesql-serversysadminsecurityworkspace
4 Posts 4 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.
  • K Offline
    K Offline
    Keshav V Kamat 0
    wrote on last edited by
    #1

    Hello all, I am using an sql server for my application. I am creating the sql connection and modifying the database as I like. the connection is as follows.

    SqlConnection conn = new SqlConnection("Data Source=" + Environment.MachineName + "\\WINCC;Integrated Security=SSPI;Initial Catalog=Logger; Packet Size = 32766;");

    the application runs perfectly fine where the sql server is installed I want to make sure that this application runs on a machine where sql server is not installed

    Keshav Kamat :) India

    C V B 3 Replies Last reply
    0
    • K Keshav V Kamat 0

      Hello all, I am using an sql server for my application. I am creating the sql connection and modifying the database as I like. the connection is as follows.

      SqlConnection conn = new SqlConnection("Data Source=" + Environment.MachineName + "\\WINCC;Integrated Security=SSPI;Initial Catalog=Logger; Packet Size = 32766;");

      the application runs perfectly fine where the sql server is installed I want to make sure that this application runs on a machine where sql server is not installed

      Keshav Kamat :) India

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      How is that possible ? What do you expect to do ?

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      1 Reply Last reply
      0
      • K Keshav V Kamat 0

        Hello all, I am using an sql server for my application. I am creating the sql connection and modifying the database as I like. the connection is as follows.

        SqlConnection conn = new SqlConnection("Data Source=" + Environment.MachineName + "\\WINCC;Integrated Security=SSPI;Initial Catalog=Logger; Packet Size = 32766;");

        the application runs perfectly fine where the sql server is installed I want to make sure that this application runs on a machine where sql server is not installed

        Keshav Kamat :) India

        V Offline
        V Offline
        Vikram A Punathambekar
        wrote on last edited by
        #3

        What do you want to do? :confused: If you want to connect to a database on a machine called XXXYYY every time, you will have to replace Environment.MachineName with XXXYYY. How do you expect to connect to a database that doesn't exist?

        Cheers, Vikram.


        The cold will freeze our stares We won't care...

        1 Reply Last reply
        0
        • K Keshav V Kamat 0

          Hello all, I am using an sql server for my application. I am creating the sql connection and modifying the database as I like. the connection is as follows.

          SqlConnection conn = new SqlConnection("Data Source=" + Environment.MachineName + "\\WINCC;Integrated Security=SSPI;Initial Catalog=Logger; Packet Size = 32766;");

          the application runs perfectly fine where the sql server is installed I want to make sure that this application runs on a machine where sql server is not installed

          Keshav Kamat :) India

          B Offline
          B Offline
          Brady Kelly
          wrote on last edited by
          #4

          I suspect you are creating the SqlConnection somewhere else from where you actually need it. If you can handle not having a SQL Server installed in some places in your code, then the connection object shouldn't be known to those sections of code. What I mean is, only create a SqlConnection directly inside the code that uses 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