Announcement

Collapse
No announcement yet.

Newbie SQL Connection

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Newbie SQL Connection

    Hi I'm trying to connect to a MS SQL Server 2005 database but I am unable to.

    I have taken the connection string from the myLittleAdmin screen:

    Connection string: Data Source=(local);Network Library=;Connection Timeout=15;Packet Size=4096;Integrated Security=no;User ID=sharkli1;Encrypt=no;
    Connection timeout: 15
    Database: master
    Datasource: (local)
    Network packet size: 4096
    Server version: 09.00.1399
    Work station id: DB2005

    so I've been using:

    "Data Source=(local);Network Library=;Connection Timeout=15;Packet Size=4096;Integrated Security=no;User ID=sharkli1;Encrypt=no;"

    I have a database called 'Meals' that I would like to connect to.

    The code I'm using to try and open a connection is c#.NET 2.0:

    string strConn = "Data Source=(local);Network Library=;Connection Timeout=15;Packet Size=4096;Integrated Security=no;User ID=sharkli1;Encrypt=no;"

    SqlConnection conn = new SqlConnection();
    conn.ConnectionString += strConn;
    conn.Open();

    Can anybody help?

  • #2
    Originally posted by sharkeyboy View Post
    Hi I'm trying to connect to a MS SQL Server 2005 database but I am unable to.

    I have taken the connection string from the myLittleAdmin screen:

    Connection string: Data Source=(local);Network Library=;Connection Timeout=15;Packet Size=4096;Integrated Security=no;User ID=sharkli1;Encrypt=no;
    Connection timeout: 15
    Database: master
    Datasource: (local)
    Network packet size: 4096
    Server version: 09.00.1399
    Work station id: DB2005

    so I've been using:

    "Data Source=(local);Network Library=;Connection Timeout=15;Packet Size=4096;Integrated Security=no;User ID=sharkli1;Encrypt=no;"

    I have a database called 'Meals' that I would like to connect to.

    The code I'm using to try and open a connection is c#.NET 2.0:

    string strConn = "Data Source=(local);Network Library=;Connection Timeout=15;Packet Size=4096;Integrated Security=no;User ID=sharkli1;Encrypt=no;"

    SqlConnection conn = new SqlConnection();
    conn.ConnectionString += strConn;
    conn.Open();

    Can anybody help?
    Hi,

    First make sure if your database is accessible or not.

    try connecting to your database from ms sql management studio, if you are able to connect remotely, then there is no connection issues.

    Try using the instance name or server IP instead of (local)

    If you need help with on connection string , you can visit the url below :

    SQL Server 2005 Connection String Samples - ConnectionStrings.com


    If you have a hosting Plan with us, you can get in touch with our Admins over live chat or raise a support ticket for exact details for your server
    Chris White
    (Former eUK Employee)


    UK's premier web hosting company.

    Comment

    Working...
    X