SQL Connection Strings using .net sqlclient.sqlConnection


  • Currently I am Lost and Clueless...and really could use some help....     (.net 2005)

    Using ADO I am able to connect to SQL Server from outside my network as follows....

    Dim A as New ADODB.Connection
    A.Open("Provider=SQLOLEDB;Initial Catalog=DBName;Integrated Security='';Persist Security Info=False;Data Source=server IP address,winsock tcp/ip port;Network Library=dbmssocn;User ID=domain\user id;Password=password")

    I know you will see something that shouldn't work Integrated Security='', but believe it or not, this is the only way it will work....using No or False produces:

    Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

    So, what the heck.....   To be more mainstream I figured why not employ the Dataset so I can put the datagridview to work, work in a memory with the Dataset and update the DB when done...little connection time.....SO......

    I've employed this....

    Dim D As New SqlClient.SqlConnection("Database=THGName;Server=server ip address,winsock tcpip port;Network Library=dbmssocn;User ID=domain\user id;Password=password;Trusted_Connection=False;")D.Open()

    I've tried every conceivable variation of this...Integrated Security=no and false...trusted_connection=no..I've taken things out, added things in (even Type System Version=SQL Server 2000;)....but always come to one very definate result.... I guess this is my lesson in humility.....

    Login failed for user 'domain\user id'

    I mean, it's the same connection to the same DB and server as the ADO connection..."What Could I Possibly Be Missing??????"

    It's apparent I am doing something wrong, but after 4 hours and a million variations of the string above...I am LICS  (Lost In Cyber Space)...

    Any Help would be Greatly Appreciated!

    Thursday, August 14, 2008 12:18 AM


All replies

  • Hi Tim,

    This forum is for SQL Server Data Services. You might want to post your question here ->

    Good luck,
    Thursday, August 14, 2008 10:14 PM
  • Hello Tim,

    I am kind of new working with Data bases, I normally work with control systems but this time I was asked to develop a soft app in wich a user in any part of the world connects to a server in my LAN.  I believe that the first thing I have to do is to get a fix IP address, is that correct? Secondly I have to configure the modem that distributes the internet to my lan, is that correct? 
    I would appreciate if you provide me info related to this application or if you can let me know where I can find this info.

    Friday, August 15, 2008 2:24 AM
  • Hi Dave,

    Thanks for the info...  I'm new to these Forums....  I'll give that a look...

    Have a Great Day,
    Wednesday, August 20, 2008 11:21 PM
  • Hi Fausto,

    Using ADO, connections to a DB on the LAN/WAN doesn't seem to be a problem, however using this also has the drawback of many calls to the DB/Network Use.  Not to mention Stateful connection can have a lot of overhead. 

    What appears to be a good method,, using DataSets.  However, as indicated above, I've yet to be able to authenticate using this (Authentication Failed for user domain/user ID).

    I think, as we both appear to be looking for an answer to the same basic question, this is the location I am starting at (Thanks to Dave Above)..

    Good Luck,
    Have a Great Day,
    Wednesday, August 20, 2008 11:31 PM