Can't connect to remote sql server from asp.net buk ok from Enterprise Manager

ASP.NET

    Next

  • 1. Changing skinId on custom control HELP!
    Hello! I made custom control with tables and labels in it. In my page I have several of these controls. Each one should have different color of tables etc. I have different SkinIDs for that. When my Default page loads I'd like to set SkinID for each of these controls. I understand that Page_PreInit should have this but I can't access my control's properties from there. I also know that control can't have PreInit, only Page. I spent last ten hours trying to get around this. I don't know what to do. HELP Thank you, Hrvoje
  • 2. Line feeds in a GridView
    Hi, If a database field contains more than one line of text, i.e. Several Environment.NewLine characters, the GridView cell ignores them. If I replace the NewLine with "<br />" - the GridView helpfully converts that string to "<br %gt;" and so I don't get the CrLf - arrgh! this used to be easy, am I missing a simple trick? The colums are autogenerated, which works perfectly except for this problem. Can anyone help? TIA
  • 3. error building my app
    Hello, i get an error when i am building my app, Error 101 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. C:\ProjZone\zone\private\web.config 56 The actual line its refering to is: <authentication mode="Forms"/>

Re: Can't connect to remote sql server from asp.net buk ok from Enterprise Manager

Postby Mamcx » Sat, 19 Jul 2003 07:53:16 GMT

Remove now aspnet user from admin group! (no matter is a test server, is a
bad practique). You server is win2003? I don't can connect to Sql Server
using NT authentication but with Sql Server authentication is fine. Create
user group with the rigth permision on the database, create a user (like
WebUser) with strong password and connect with it...



Re: Can't connect to remote sql server from asp.net buk ok from Enterprise Manager

Postby karim » Sat, 19 Jul 2003 09:15:48 GMT




aspnet has more rights that it should. I know and certainly this is not the 
cause of the problem.

Rmember I said the app connects fine from my development machine. This 
means the user and password on the database work fine.

Karim

Re: Can't connect to remote sql server from asp.net buk ok from Enterprise Manager

Postby bruce barker » Sat, 19 Jul 2003 09:30:34 GMT

you must use tcp/ip and standard security for your configuration to work.
named pipes requires an authenticated connection and is subject to the one
hop rule. turn off named pipe support on your sqlserver and see if you can
still connect.

-- bruce





is



Similar Threads:

1.Problem connecting to SQL Server from ASP on separate server (ASP.NET works ok)

Firstly, apologies for the long post, but I though it best to outline
everything I've done rather then waste anyone's time.

I have a web app that uses both ASP and ASP.Net with a SQL server 2000
backend. I was running IIS & SQL server on the same box and recently
decided to move SQL server to a separate machine. In the example
below, my IIS server is called 'TREVOR' and my SQL server is called
'RALPH' - both are running Win2K with SP5.

Getting ODBC connectivity to work has caused no end of problems. After
a lot of mucking around I have been able to get requests from ASP.Net
to connect OK, but requests from ASP stubbornly refuse to connect.

For simplicity, I decided to use the 'ASPNET' user name for both
ASP.Net and ASP ODBC requests. I have created a ASPNET user on both
TREVOR and RALPH and synchronised the password to 'myPassword'.

I have set SQL Server Authentication to be windows only. 

Under the SQL Server login properties, the user RALPH\ASPNET appears
as a 'Windows User' has been granted access to the default database
'myDB'. Within this database, I have created a roll called 'IIS' with
various permissions to tables within the database. I have added the
user 'ASPNET' to the roll 'IIS'.

To work out what was going on, I configured SQL server to log all
login attempts to the Application log.


1. Steps used to get ASP.Net working:
1a) edited the machine.config file to include:

  <processModel
    
    userName="ASPNET"
    password="myPassword"
  />

1b) modified the ODBC connection string to:

Dim sConn As String = "data source=RALPH;initial
catalog=myDB;integrated security=SSPI;persist security
info=False;workstation id=TREVOR;packet size=4096"
Dim myConnection As SqlConnection = New SqlConnection(sConn)
Dim myCommand As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM
myTable", myConnection)

1c) noted that access from ASP.Net are logged successfully in the
Application log as:

18453 : Login succeeded for user 'RALPH\ASPNET'. Connection: Trusted.


Ok, all well and good so far. However .

2. To setup ASP to connect to a remote SQL server I have:
2a) Under 'Computer Management (local)' on TREVOR, drilled down to
'Services and Applications' >> 'Internet Information Services' >>
'myWebSite' and right clicked to select properties. Under the
'Directory Services' tab, selected the 'Edit' Anonymous and
Authentication control button and checked 'Anonymous Access'.
Selecting the 'Edit' button I have added the username 'RALPH\ASPNET'
and entered the password 'myPassword' (the option 'Allow IIS to
Control Passwords' is unchecked). Note, I have also experimented
unsuccessfully with the usernames 'TREVOR\ASPNET' and 'ASPNET'

After changing the user name IIS should be operating under, I have
shelled to DOS and run the command 'IISRESET' to ensure it reloads.

2b) Setup an ASP test page with:

<<% @ LANGUAGE = VBScript >>
<
<
<<>>ODBC Connectivity tes<
<<>>
<<%
  sConn = "Driver={SQL Server};Server=RALPH;Database=myDB;UID=
RALPH\ASPNET;PWD=myPassword;"
  dim oConn
  Set oConn= Server.CreateObject("ADODB.Connection")
  oConn.open sConn 

  Response.Write("Open Connection<")

>>
<

This page throws the error message:

Microsoft OLE DB Provider for ODBC Drivers error '80040e4d' 
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'RALPH\ASPNET'. Reason: Not associated with a trusted SQL Server
connection.

Under the application log the attempt is logged as:

18452 : Login failed for user 'RALPH\ASPNET'. Reason: Not associated
with a trusted SQL Server connection.


So, my problem is 

I cannot figure out why under ASP.Net the user 'RALPH\ASPNET'' is
treated as a 'Connection: Trusted', but under ASP I'm told the same
user is 'Not associated with a trusted SQL Server connection'. Can
anyone help?

Also,

Isn't is a bit crap that I have to have the password for the ASPNET
user lying around in plain text in the machine.config and in my
test.asp page? Is there an alternative?


Thanks,

Stephen

2.Can't connect to remote SQL database from localhost ASP.NET ap

3.Can't connect to remote SQL database from localhost ASP.NET app

Hello,

Our company just broke out its single network into a LAN network behind an 
ISA Server firewall and a production network.  Our ASP.NET applications 
running on localhost are not able to connect to the remote SQL Server 
(residing in the production network, of course) under any 
settings/connectionstring combination we have tried.  We have tried using 
impersonation on the site and TCP/IP connections, which we thought would 
temporarily solve the problem, but no luck. Ideally, we want to use 
connection strings with SQL authentication (not windows auth), TCP/IP, and we 
do NOT want to have to use impersonation on the site.  Every time our code 
attempts to open a database connection under any of these configurations, we 
always get the error "SQL Server does not exist or access denied".  We are 
able to connect to the remote SQL Server from our dev machines every other 
way: from Query Analyzer, Windows applications, and even through an ADO 
connection running through ASP (not asp.net) on localhost pages using a the 
SQLOLEDB provider.  Can someone point us in the right direction for solving 
this frustrating problem?

Thanks in advance,
Barb

4.VS.Net 2005 can't connect to remote SQL Server instance

I'm having an issue with VS.Net 2005.  I just installed it and can't 
connect any remote SQL instance from the IDE.  My project is set up to 
reference a remote SQL 2000 DB.  I can connect to the SQL DB from Enterprise 
Manager and VS.Net 2003.  Anyone else have this problem?  Just another 
note - the code just hangs when I get to the "cn.open" line. 

chris hankey

5.SQL Server Enterprise Manager or other tool to connect to remote SQL DB

I am looking for a free tool to connect and manage a 
remote SQL Server 2000 DB ... anyone?

6. Can't connect to remote SQL Server using VS.NET 2K3 Server Explore

7. Can't connect to remote SQL Server using VS.NET 2K3 Server Explorer

8. Service Manager ok but Enterprise Mgr cant connect



Return to ASP.NET

 

Who is online

Users browsing this forum: No registered users and 51 guest