|
-
Aug 21st, 2002, 12:43 PM
#1
Thread Starter
Hyperactive Member
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:
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.
-
Aug 21st, 2002, 01:20 PM
#2
Thread Starter
Hyperactive Member
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.
-
Aug 22nd, 2002, 04:26 AM
#3
Member
Where exactly in code are you creating the MyConnection connection object?
Could you show a little more of your code?
-
Aug 22nd, 2002, 07:17 AM
#4
Thread Starter
Hyperactive Member
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:
Public Class Main
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Dim MyConnection As New SqlConnection("server='c1156\sql2000';database=CSS_Training;Trusted_Connection=yes;User ID=C1156\IUSR_C1103;Password=scott")
Dim MyConnection As New SqlConnection("server='c1156\sql2000';Trusted_Connection=yes;Integrated Security=sspi;database=CSS_Training;User ID=C1156\IUSR_C1103;Password=scott")
Dim MyCommand As New SqlDataAdapter("SevenDays", MyConnection)
MyCommand.SelectCommand.CommandType = CommandType.StoredProcedure
MyCommand.SelectCommand.Connection.Open()
Try
MyCommand.SelectCommand.ExecuteNonQuery()
Catch Exc As SqlException
'Error Message
End Try
Dim DS As New DataSet()
MyCommand.Fill(DS, "View_Courses_emps")
MyCommand.SelectCommand.Connection.Close()
DataList1.DataSource = DS.Tables("View_Courses_emps").DefaultView
DataList1.DataBind()
End Sub
End Class
-
Aug 28th, 2002, 02:42 PM
#5
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|