Problems in connecting to Sql server 2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cmrhema
    Contributor
    • Jan 2007
    • 375

    Problems in connecting to Sql server 2005

    Hi,
    I am trying to connect vb.net 2005 to sql server 2005
    But i just cannot login. Its giving me an eroor stating that login failed. I have not used any password(becaus e i do not have any) I use windows authentication.

    But i would like to add here that when i click on server explorer(right side). i cannot view my sql server but if i write my username on it then my databases do appear.

    where does the problem lie?

    Any one please...

    thanks




    =======

    in fact i tried out now it works in vb.net but not in asp,net
    here's the coding for vb.net
    MyCon = New SqlConnection(" server=111.111. 1.111;uid=;pwd= ;database=demo" )
    MsgBox("open")


    Any help please
    Last edited by cmrhema; Jul 31 '07, 12:13 PM. Reason: Adding some details
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Well I don't think that is a valid connection string for one thing.
    (See http://www.connectionstrings.com/ for correct forms)

    Do all the correct users have login rights to the SQL server?
    ASP.NET will probably need the ASP_NET user or (IUSER depending) to have login rights on the SQL server

    Comment

    • cmrhema
      Contributor
      • Jan 2007
      • 375

      #3
      Originally posted by Plater
      Well I don't think that is a valid connection string for one thing.
      (See http://www.connectionstrings.com/ for correct forms)

      Do all the correct users have login rights to the SQL server?
      ASP.NET will probably need the ASP_NET user or (IUSER depending) to have login rights on the SQL server
      Plater, thanks for your response
      got connected
      Code:
      SqlConnection MyCon = new SqlConnection("Server=HEMA\\SQLEXPRESS;Integrated Security=SSPI;database=demo");
      This works for me
      I would like to add one more thing.
      I could connect to the remote server but not my server which was installed on my pc.
      But anyway the above code worked.

      thanks again

      Comment

      Working...