Results 1 to 5 of 5

Thread: Now you see it, Now you don't (Connection Problems)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Posts
    306

    Now you see it, Now you don't (Connection Problems)

    This is a strange problem...or maybe I'm just stupid.

    I'm creating an ASP.Net web application that interfaces with SQL Server 2000. Everything works fine on my development machine. I'm able to view the webpage through the IDE as well as if I open up IE and type in the address (http://C1156/css-training).

    But when I try and look at the webpage by way of another computer I get a login error (Login failed for user '\'.).


    My Connection string is as follows:

    VB Code:
    1. Dim MyConnection as New SqlConnection("Server=c1156\sql2000;Integrated Security=true;database=css_training;User ID=IUSR_C1103;Password=scott")

    I've got Impersonation set to True in my webconfig file. Anybody have a clue as to my error? it has to be in the connection string.

    Thanks
    Last edited by scostell; Aug 21st, 2002 at 12:46 PM.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Posts
    306

    Possible Clue??

    Playing around a little bit more with it I've noticed this:

    If on my development machine I View The Page First, i then am able to view the page on the client machine.

    The reason I think it's working only after I view the page from my development machine is that it must be logging into the Database Server and thus opening up the connection so the client machine can view the page.

    If anyone has any other suggestions or fixes you'd be my hero.

  3. #3
    Member
    Join Date
    Sep 2001
    Location
    Fishburn
    Posts
    45
    Where exactly in code are you creating the MyConnection connection object?

    Could you show a little more of your code?

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Posts
    306
    Here is the code that connects to the database. It's in my code behind section. I've also got Authentication Mode set to Windows in my web.config file.

    VB Code:
    1. Public Class Main
    2.  
    3.     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    4.         'Dim MyConnection As New SqlConnection("server='c1156\sql2000';database=CSS_Training;Trusted_Connection=yes;User ID=C1156\IUSR_C1103;Password=scott")
    5.         Dim MyConnection As New SqlConnection("server='c1156\sql2000';Trusted_Connection=yes;Integrated Security=sspi;database=CSS_Training;User ID=C1156\IUSR_C1103;Password=scott")
    6.  
    7.         Dim MyCommand As New SqlDataAdapter("SevenDays", MyConnection)
    8.  
    9.         MyCommand.SelectCommand.CommandType = CommandType.StoredProcedure
    10.         MyCommand.SelectCommand.Connection.Open()
    11.  
    12.         Try
    13.             MyCommand.SelectCommand.ExecuteNonQuery()
    14.         Catch Exc As SqlException
    15.             'Error Message
    16.         End Try
    17.        
    18.         Dim DS As New DataSet()
    19.         MyCommand.Fill(DS, "View_Courses_emps")
    20.  
    21.  
    22.         MyCommand.SelectCommand.Connection.Close()
    23.         DataList1.DataSource = DS.Tables("View_Courses_emps").DefaultView
    24.         DataList1.DataBind()
    25.  
    26.     End Sub
    27.  
    28. End Class

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Posts
    306
    I figured it all out....Just had to play with the IIS Security some.

    Thanks for those who helped

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width