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. Connect to SQL on same machine! help

Connect to SQL on same machine! help

Scheduled Pinned Locked Moved Database
sysadminquestioncsharpdatabasewindows-admin
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.
  • D Offline
    D Offline
    darXstar
    wrote on last edited by
    #1

    Hi. I've this question: I have IIS (and dot net environment) and MS SQL msde on same machine (MS Windows 2000 server). For security reason I've switched off all network protocols of Sql. (sql is listening on shared memory) Is it still possible to connect to sql (not using odbc) ?? I nedd to modify my ADO.NET connection string? Could someone showme an exemple? thanks to anyone.

    C 1 Reply Last reply
    0
    • D darXstar

      Hi. I've this question: I have IIS (and dot net environment) and MS SQL msde on same machine (MS Windows 2000 server). For security reason I've switched off all network protocols of Sql. (sql is listening on shared memory) Is it still possible to connect to sql (not using odbc) ?? I nedd to modify my ADO.NET connection string? Could someone showme an exemple? thanks to anyone.

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

      darXstar wrote: Is it still possible to connect to sql (not using odbc) ?? I've never tried that configuration, but it should be possible. darXstar wrote: I nedd to modify my ADO.NET connection string? darXstar wrote: I nedd to modify my ADO.NET connection string? I wouldn't think so, why not just try it? I've got loads of apps lying around that were just to try out something where the docs didn't give a complete explanation or I just wanted to see how something worked in isolation. darXstar wrote: Could someone showme an exemple? Of what? Connecting to a SQL Server database using ADO.NET.

      string connectionString = "server=(local);database=myData;uid=a;pwd=b";
      SqlConnection conn = new SqlConnection(connectionString);
      SqlCommand cmd = new SqlCommand();
      cmd.CommandText = "myStoredProcedure";
      cmd.CommandType = CommandType.StoredProcedure;
      cmd.Connection = conn;
      SqlReader reader = cmd.ExecuteReader();
      while(reader.Read())
      {
      // Do stuff to process the information being returned from
      // the database
      }

      Does this help?


      My: Blog | Photos "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious

      D 1 Reply Last reply
      0
      • C Colin Angus Mackay

        darXstar wrote: Is it still possible to connect to sql (not using odbc) ?? I've never tried that configuration, but it should be possible. darXstar wrote: I nedd to modify my ADO.NET connection string? darXstar wrote: I nedd to modify my ADO.NET connection string? I wouldn't think so, why not just try it? I've got loads of apps lying around that were just to try out something where the docs didn't give a complete explanation or I just wanted to see how something worked in isolation. darXstar wrote: Could someone showme an exemple? Of what? Connecting to a SQL Server database using ADO.NET.

        string connectionString = "server=(local);database=myData;uid=a;pwd=b";
        SqlConnection conn = new SqlConnection(connectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandText = "myStoredProcedure";
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Connection = conn;
        SqlReader reader = cmd.ExecuteReader();
        while(reader.Read())
        {
        // Do stuff to process the information being returned from
        // the database
        }

        Does this help?


        My: Blog | Photos "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious

        D Offline
        D Offline
        darXstar
        wrote on last edited by
        #3

        Hi, and thanks for reply. You have right. Why don't try? The truth is that I was almost sure this configuration was working on my test server... but today doesn't work anymore... While I keep switched off TCP protocol of sql server, I can not access it from asp.net web applications. the result is "Server doesn't exist or access denied". I am little bit confused... I can't tell if this configuration should work or not... About connection string I was asking someone if there are a specific one using "Shared Memory" access mode. anyone is experienced? thanks again

        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