Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Sunday, March 25, 2012

Connectivity Issues - Bizzare

I am trying to connect to a default instance of SQL Server 2000 Enterprise on
a remote network server using ADO.NET objects through ASP.NET Web Application.
The SQL SERVER is on a Windows XP machine (no firewall enabled) with TCP/IP
and Named Pipes enabled
For the test purposes, I created a new Web Form, created a new SqlConnection
in the Server Explorer to the remote database. I test the connection is VS
IDE and everything is fine. I create a SqlDataAdapter on the web form,
generate a dataset, test the dataset and the results are valid. I bind the
SqlDataAdapter to a datagrid and run the webform. I now get the following
error.
System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied.
at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at DBConnTest.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\dbconntest\webform1.aspx.cs:lin e 39
Hmph! I take the same connection string from the web app, create a win app.
Place a datagrid on the form, do the binding and load the app. Hey Presto! it
works.
I used TCPView (systeminternals.com) and I can see aspnet_wp trying to
create a connection, but its at though SQL Server is rejecting the
connection, although I see no failures in SQL Server.
Any thoughts would be much appreciated.
Andy
Sounds like firewall to me.
As a quick test to see if firewall is blocking port, try this from command
prompt on client machine ->
telnet mysqlmachine 1433
If you can't telnet to 1433, then you have firewall issue.
Matt Neerincx [MSFT]
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
"Andy Furnival" <AndyFurnival@.discussions.microsoft.com> wrote in message
news:40AC00C0-0402-452B-AAC8-F25D97E94ACD@.microsoft.com...
>I am trying to connect to a default instance of SQL Server 2000 Enterprise
>on
> a remote network server using ADO.NET objects through ASP.NET Web
> Application.
> The SQL SERVER is on a Windows XP machine (no firewall enabled) with
> TCP/IP
> and Named Pipes enabled
> For the test purposes, I created a new Web Form, created a new
> SqlConnection
> in the Server Explorer to the remote database. I test the connection is VS
> IDE and everything is fine. I create a SqlDataAdapter on the web form,
> generate a dataset, test the dataset and the results are valid. I bind the
> SqlDataAdapter to a datagrid and run the webform. I now get the following
> error.
> System.Data.SqlClient.SqlException: SQL Server does not exist or access
> denied.
> at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
> isInTransaction)
> at
> System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
> options, Boolean& isInTransaction)
> at System.Data.SqlClient.SqlConnection.Open()
> at DBConnTest.WebForm1.Page_Load(Object sender, EventArgs e) in
> c:\inetpub\wwwroot\dbconntest\webform1.aspx.cs:lin e 39
> Hmph! I take the same connection string from the web app, create a win
> app.
> Place a datagrid on the form, do the binding and load the app. Hey Presto!
> it
> works.
> I used TCPView (systeminternals.com) and I can see aspnet_wp trying to
> create a connection, but its at though SQL Server is rejecting the
> connection, although I see no failures in SQL Server.
> Any thoughts would be much appreciated.
> Andy

Thursday, March 22, 2012

Connectivity Issues - Bizzare

I am trying to connect to a default instance of SQL Server 2000 Enterprise o
n
a remote network server using ADO.NET objects through ASP.NET Web Applicatio
n.
The SQL SERVER is on a Windows XP machine (no firewall enabled) with TCP/IP
and Named Pipes enabled
For the test purposes, I created a new Web Form, created a new SqlConnection
in the Server Explorer to the remote database. I test the connection is VS
IDE and everything is fine. I create a SqlDataAdapter on the web form,
generate a dataset, test the dataset and the results are valid. I bind the
SqlDataAdapter to a datagrid and run the webform. I now get the following
error.
System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at DBConnTest.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\dbconntest\webform1.aspx.cs:line 39
Hmph! I take the same connection string from the web app, create a win app.
Place a datagrid on the form, do the binding and load the app. Hey Presto! i
t
works.
I used TCPView (systeminternals.com) and I can see aspnet_wp trying to
create a connection, but its at though SQL Server is rejecting the
connection, although I see no failures in SQL Server.
Any thoughts would be much appreciated.
AndySounds like firewall to me.
As a quick test to see if firewall is blocking port, try this from command
prompt on client machine ->
telnet mysqlmachine 1433
If you can't telnet to 1433, then you have firewall issue.
Matt Neerincx [MSFT]
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
"Andy Furnival" <AndyFurnival@.discussions.microsoft.com> wrote in message
news:40AC00C0-0402-452B-AAC8-F25D97E94ACD@.microsoft.com...
>I am trying to connect to a default instance of SQL Server 2000 Enterprise
>on
> a remote network server using ADO.NET objects through ASP.NET Web
> Application.
> The SQL SERVER is on a Windows XP machine (no firewall enabled) with
> TCP/IP
> and Named Pipes enabled
> For the test purposes, I created a new Web Form, created a new
> SqlConnection
> in the Server Explorer to the remote database. I test the connection is VS
> IDE and everything is fine. I create a SqlDataAdapter on the web form,
> generate a dataset, test the dataset and the results are valid. I bind the
> SqlDataAdapter to a datagrid and run the webform. I now get the following
> error.
> System.Data.SqlClient.SqlException: SQL Server does not exist or access
> denied.
> at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
> isInTransaction)
> at
> System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConn
ectionString
> options, Boolean& isInTransaction)
> at System.Data.SqlClient.SqlConnection.Open()
> at DBConnTest.WebForm1.Page_Load(Object sender, EventArgs e) in
> c:\inetpub\wwwroot\dbconntest\webform1.aspx.cs:line 39
> Hmph! I take the same connection string from the web app, create a win
> app.
> Place a datagrid on the form, do the binding and load the app. Hey Presto!
> it
> works.
> I used TCPView (systeminternals.com) and I can see aspnet_wp trying to
> create a connection, but its at though SQL Server is rejecting the
> connection, although I see no failures in SQL Server.
> Any thoughts would be much appreciated.
> Andy

ConnectionString without Password

Hello!

I am working at a ASP.NET Project with has a sign-in area. All users (the aspnet_Membership and so on) are on an external SQL Server stored.

The ConnectionString in the web.config looks like this:

<add name="hspWerbung" connectionString="Persist Security Info=False;User ID=XXXXX;Password=XXXXX;Initial Catalog=HSPWERBUNG01;Data Source=SERVER_SQL_02\STOCKHOLM"
providerName="System.Data.SqlClient" /
Is there any way to create a ConnectionString without the User ID and without the password?

When i want to reach my site on the web (not with http://localhost/...) , i can't do it with "Integrated Security=True", because there will be no user, or?

hi, some where we have to store the user name and pwd. the alternative apoach is to encript them and store in the xml file using hash algorthim. when ever you are trying to connect to the DB get the string and decript it and store in the cache or session.

sqlsql

Connectionstring W/O password

I have an asp.net 1.1 application that has to access a SQL Server DB on
another server. In the past we have simply put UID and PWD in the
connectionstring and everything works well.
We now have a client that insists we not include pwd in the connection
string. Although this is easy to do when the DB is on the same server,
using NT Authority, I don't know how to do it when the db is on another
server.
Someone told me to "set up identical service accounts" but I don't know what
that means. I know it's easy to encrypt a connection string in 2.0 but this
is a 1.1 app.
Can someone tell me how this is best done?
Thanks,
TTina
Are both servers in the same domain?
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>I have an asp.net 1.1 application that has to access a SQL Server DB on
>another server. In the past we have simply put UID and PWD in the
>connectionstring and everything works well.
> We now have a client that insists we not include pwd in the connection
> string. Although this is easy to do when the DB is on the same server,
> using NT Authority, I don't know how to do it when the db is on another
> server.
> Someone told me to "set up identical service accounts" but I don't know
> what that means. I know it's easy to encrypt a connection string in 2.0
> but this is a 1.1 app.
> Can someone tell me how this is best done?
> Thanks,
> T
>|||I already answered this question below. If you open different topics then we
can not reach to the happy end.
If you are in a domain then you'll not need to create identical accounts on
both servers, it would be enough to create a Login in your SQL Server
Instance for the account you want to log in to your SQL Server and use this
domain account for your ASP app in its conn str.
If those servers are not in the same domain but in the same network then try
my suggestion which is under your previous topic.
Ekrem nsoy
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>I have an asp.net 1.1 application that has to access a SQL Server DB on
>another server. In the past we have simply put UID and PWD in the
>connectionstring and everything works well.
> We now have a client that insists we not include pwd in the connection
> string. Although this is easy to do when the DB is on the same server,
> using NT Authority, I don't know how to do it when the db is on another
> server.
> Someone told me to "set up identical service accounts" but I don't know
> what that means. I know it's easy to encrypt a connection string in 2.0
> but this is a 1.1 app.
> Can someone tell me how this is best done?
> Thanks,
> T
>|||no. they are in different workgroups. Why do you ask? I could probably put
them in a domain system and in the same domain.
T
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
> Tina
> Are both servers in the same domain?
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>|||If they are , this login should exist in Active Directory and to be seen
from both machine
You can create a login let me say ASP_USER (on both machine) to access
both machines.
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:uTzaEX1NIHA.4832@.TK2MSFTNGP04.phx.gbl...
> no. they are in different workgroups. Why do you ask? I could probably
> put them in a domain system and in the same domain.
> T
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
>|||They don't use active directory
T
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uoYZ8b1NIHA.3852@.TK2MSFTNGP06.phx.gbl...
> If they are , this login should exist in Active Directory and to be
> seen from both machine
> You can create a login let me say ASP_USER (on both machine) to access
> both machines.
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:uTzaEX1NIHA.4832@.TK2MSFTNGP04.phx.gbl...
>

Connectionstring W/O password

I have an asp.net 1.1 application that has to access a SQL Server DB on
another server. In the past we have simply put UID and PWD in the
connectionstring and everything works well.
We now have a client that insists we not include pwd in the connection
string. Although this is easy to do when the DB is on the same server,
using NT Authority, I don't know how to do it when the db is on another
server.
Someone told me to "set up identical service accounts" but I don't know what
that means. I know it's easy to encrypt a connection string in 2.0 but this
is a 1.1 app.
Can someone tell me how this is best done?
Thanks,
TTina
Are both servers in the same domain?
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>I have an asp.net 1.1 application that has to access a SQL Server DB on
>another server. In the past we have simply put UID and PWD in the
>connectionstring and everything works well.
> We now have a client that insists we not include pwd in the connection
> string. Although this is easy to do when the DB is on the same server,
> using NT Authority, I don't know how to do it when the db is on another
> server.
> Someone told me to "set up identical service accounts" but I don't know
> what that means. I know it's easy to encrypt a connection string in 2.0
> but this is a 1.1 app.
> Can someone tell me how this is best done?
> Thanks,
> T
>|||I already answered this question below. If you open different topics then we
can not reach to the happy end.
If you are in a domain then you'll not need to create identical accounts on
both servers, it would be enough to create a Login in your SQL Server
Instance for the account you want to log in to your SQL Server and use this
domain account for your ASP app in its conn str.
If those servers are not in the same domain but in the same network then try
my suggestion which is under your previous topic.
--
Ekrem Önsoy
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>I have an asp.net 1.1 application that has to access a SQL Server DB on
>another server. In the past we have simply put UID and PWD in the
>connectionstring and everything works well.
> We now have a client that insists we not include pwd in the connection
> string. Although this is easy to do when the DB is on the same server,
> using NT Authority, I don't know how to do it when the db is on another
> server.
> Someone told me to "set up identical service accounts" but I don't know
> what that means. I know it's easy to encrypt a connection string in 2.0
> but this is a 1.1 app.
> Can someone tell me how this is best done?
> Thanks,
> T
>|||no. they are in different workgroups. Why do you ask? I could probably put
them in a domain system and in the same domain.
T
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
> Tina
> Are both servers in the same domain?
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>>I have an asp.net 1.1 application that has to access a SQL Server DB on
>>another server. In the past we have simply put UID and PWD in the
>>connectionstring and everything works well.
>> We now have a client that insists we not include pwd in the connection
>> string. Although this is easy to do when the DB is on the same server,
>> using NT Authority, I don't know how to do it when the db is on another
>> server.
>> Someone told me to "set up identical service accounts" but I don't know
>> what that means. I know it's easy to encrypt a connection string in 2.0
>> but this is a 1.1 app.
>> Can someone tell me how this is best done?
>> Thanks,
>> T
>|||If they are , this login should exist in Active Directory and to be seen
from both machine
You can create a login let me say ASP_USER (on both machine) to access
both machines.
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:uTzaEX1NIHA.4832@.TK2MSFTNGP04.phx.gbl...
> no. they are in different workgroups. Why do you ask? I could probably
> put them in a domain system and in the same domain.
> T
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
>> Tina
>> Are both servers in the same domain?
>> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
>> news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>>I have an asp.net 1.1 application that has to access a SQL Server DB on
>>another server. In the past we have simply put UID and PWD in the
>>connectionstring and everything works well.
>> We now have a client that insists we not include pwd in the connection
>> string. Although this is easy to do when the DB is on the same server,
>> using NT Authority, I don't know how to do it when the db is on another
>> server.
>> Someone told me to "set up identical service accounts" but I don't know
>> what that means. I know it's easy to encrypt a connection string in 2.0
>> but this is a 1.1 app.
>> Can someone tell me how this is best done?
>> Thanks,
>> T
>>
>|||They don't use active directory
T
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uoYZ8b1NIHA.3852@.TK2MSFTNGP06.phx.gbl...
> If they are , this login should exist in Active Directory and to be
> seen from both machine
> You can create a login let me say ASP_USER (on both machine) to access
> both machines.
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:uTzaEX1NIHA.4832@.TK2MSFTNGP04.phx.gbl...
>> no. they are in different workgroups. Why do you ask? I could probably
>> put them in a domain system and in the same domain.
>> T
>> "Uri Dimant" <urid@.iscar.co.il> wrote in message
>> news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
>> Tina
>> Are both servers in the same domain?
>> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
>> news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>>I have an asp.net 1.1 application that has to access a SQL Server DB on
>>another server. In the past we have simply put UID and PWD in the
>>connectionstring and everything works well.
>> We now have a client that insists we not include pwd in the connection
>> string. Although this is easy to do when the DB is on the same server,
>> using NT Authority, I don't know how to do it when the db is on another
>> server.
>> Someone told me to "set up identical service accounts" but I don't know
>> what that means. I know it's easy to encrypt a connection string in
>> 2.0 but this is a 1.1 app.
>> Can someone tell me how this is best done?
>> Thanks,
>> T
>>
>>
>

Connectionstring W/O password

I have an asp.net 1.1 application that has to access a SQL Server DB on
another server. In the past we have simply put UID and PWD in the
connectionstring and everything works well.
We now have a client that insists we not include pwd in the connection
string. Although this is easy to do when the DB is on the same server,
using NT Authority, I don't know how to do it when the db is on another
server.
Someone told me to "set up identical service accounts" but I don't know what
that means. I know it's easy to encrypt a connection string in 2.0 but this
is a 1.1 app.
Can someone tell me how this is best done?
Thanks,
T
Tina
Are both servers in the same domain?
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>I have an asp.net 1.1 application that has to access a SQL Server DB on
>another server. In the past we have simply put UID and PWD in the
>connectionstring and everything works well.
> We now have a client that insists we not include pwd in the connection
> string. Although this is easy to do when the DB is on the same server,
> using NT Authority, I don't know how to do it when the db is on another
> server.
> Someone told me to "set up identical service accounts" but I don't know
> what that means. I know it's easy to encrypt a connection string in 2.0
> but this is a 1.1 app.
> Can someone tell me how this is best done?
> Thanks,
> T
>
|||I already answered this question below. If you open different topics then we
can not reach to the happy end.
If you are in a domain then you'll not need to create identical accounts on
both servers, it would be enough to create a Login in your SQL Server
Instance for the account you want to log in to your SQL Server and use this
domain account for your ASP app in its conn str.
If those servers are not in the same domain but in the same network then try
my suggestion which is under your previous topic.
Ekrem nsoy
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>I have an asp.net 1.1 application that has to access a SQL Server DB on
>another server. In the past we have simply put UID and PWD in the
>connectionstring and everything works well.
> We now have a client that insists we not include pwd in the connection
> string. Although this is easy to do when the DB is on the same server,
> using NT Authority, I don't know how to do it when the db is on another
> server.
> Someone told me to "set up identical service accounts" but I don't know
> what that means. I know it's easy to encrypt a connection string in 2.0
> but this is a 1.1 app.
> Can someone tell me how this is best done?
> Thanks,
> T
>
|||no. they are in different workgroups. Why do you ask? I could probably put
them in a domain system and in the same domain.
T
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
> Tina
> Are both servers in the same domain?
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:OhAc%23u0NIHA.2140@.TK2MSFTNGP03.phx.gbl...
>
|||If they are , this login should exist in Active Directory and to be seen
from both machine
You can create a login let me say ASP_USER (on both machine) to access
both machines.
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:uTzaEX1NIHA.4832@.TK2MSFTNGP04.phx.gbl...
> no. they are in different workgroups. Why do you ask? I could probably
> put them in a domain system and in the same domain.
> T
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:uiGWf60NIHA.6060@.TK2MSFTNGP05.phx.gbl...
>
|||They don't use active directory
T
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uoYZ8b1NIHA.3852@.TK2MSFTNGP06.phx.gbl...
> If they are , this login should exist in Active Directory and to be
> seen from both machine
> You can create a login let me say ASP_USER (on both machine) to access
> both machines.
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:uTzaEX1NIHA.4832@.TK2MSFTNGP04.phx.gbl...
>

ConnectionString nightmare

I'm having a hard time making a connection work in my ASP.Net page and would be most appreciative of any help. Here two different code snipets and the errors they generate:

ATTEMPT 1:

Dim cnWebDataUtility As SQLConnection
cnWebDataUtility = new SqlConnection("server="AVILA-4400; database=WebDataUtility; uid=AVILA-4400\ASPNET; pwd=;")
cnWebDataUtility.Open()

ERROR: System.Data.SqlClient.SqlException: Login failed for user 'AVILA-4400\ASPNET'. Reason: Not associated with a trusted SQL Server connection.

ATTEMPT 2:

Dim cnWebDataUtility As SQLConnection
cnWebDataUtility = new SqlConnection("server="AVILA-4400; Database=WebDataUtility; Integrated Security=SSPI")
cnWebDataUtility.Open()

ERROR: System.Data.SqlClient.SqlException: Login failed for user 'AVILA-4400\ASPNET'.

BACKGROUND INFO:

I recently installed SQL Server Developer Edition. During that installation it did not allow me to select anything but "Windows Login" (I am not sure of the exact wording) for authentication, I believe it was. I would expect this to mean, in terms of the connectionstring, "Integrated Security=SSPI." I have tried making this connection in Visual Studio .NET and it works, but when I copy the contents of the ConnectString property in the Properties window in VS to my ConnectionString in the code above, I get errors that it does not recognize a "provider" property, and so on.

How frustrating. If anyone can help me understand this mess, I'd be very grateful.

Thank you,

Paul.I've never seen a connection string with double-quotes around the 'server=' portion of the connection string (probably just a typo?). Nor have I ever seen the server name prepended to the 'uid'. Try:

server=AVILA-4400; database=WebDataUtility; uid=ASPNET; pwd=yourPassword;

I assume that "ASPNET" is the Database Login and you've omitted the password on purpose?

This should work.sqlsql

Sunday, March 11, 2012

Connection.Execute & SQL Stored Procedure

I am hopeful that those of you with more experience in the compilation of
.asp, the connection object and MS SQL Server as the DB can help me out. I
have a web app that routinely calls stored procedures in a MS SQL DB.
In one web page, I make 6 calls with the Connection.Execute 'store
procedure'. Five of the six calls execute as expected. However; I have one
call in middle of the 6 that only executes the stored procedure partially.
This particular stored procedure does quite a bit of work within the DB, mak
e
3-4 select quiries and then a few updates to a single record. In this
procedure, one of SQL update statements is constructed in a loop to ensure
the appropriate fields are updated and no others. (The fields updated vary
with the input being used) This is where the procedure will "time out". I
have reduce/elimnated all the "debuggin" code that is no esential to the
store procedure. When the dubbuging print and select statements commented
out the procedure will execute further when called from the asp page.
Has anyone run across a situation where the .asp does not allow a stored
procedure to execute to completion before executing the next line of .asp
code? If so is there a way to force the Connection.Execute call to wait unti
l
the SQL server stored procedure has completed executing before processing th
e
next line of asp? Note the stored procedure does not explicitly return
anything to the asp code... also noteworthy, if the same stored procedure is
run from the SQL Query Analyzer (a tool for MS SQL Server) the stored
procedure runs flawlessly and as expected to completion...
Anyone have an idea?Simon McLaren wrote:
> I am hopeful that those of you with more experience in the
> compilation of .asp, the connection object and MS SQL Server as the
> DB can help me out. I have a web app that routinely calls stored
> procedures in a MS SQL DB.
This would have been more on topic at .inetserver.asp.db. However, read on.

> In one web page, I make 6 calls with the Connection.Execute 'store
> procedure'. Five of the six calls execute as expected. However; I
> have one call in middle of the 6 that only executes the stored
> procedure partially. This particular stored procedure does quite a
> bit of work within the DB, make 3-4 select quiries and then a few
> updates to a single record. In this procedure, one of SQL update
> statements is constructed in a loop to ensure the appropriate fields
> are updated and no others. (The fields updated vary with the input
> being used) This is where the procedure will "time out". I have
> reduce/elimnated all the "debuggin" code that is no esential to the
> store procedure. When the dubbuging print and select statements
> commented out the procedure will execute further when called from the
> asp page.
>
There are two timeout properties to be concerned with:
1. The IIS ScriptTimeout property, which controls the max time a page will
be allowed to execute on the server. This can be set globally using IIS
Manager to modify your website's application properties. It can also be set
at the page level using:
Server.ScriptTimeout = <some reasonable value>
2. The ADO Connection's CommandTimeout property. This controls the amount of
time a Command will allow a statement to execute. If set for a longer period
of time than the ScriptTimeout, the script may time out before the command
finishes executing.This is set via:
dim cn
set cn=createobject("adodb.connection")
cn.open ...
cn.CommandTimeout = <some reasonable value>
You should go to msdn.microsoft.com/library and read the documentation about
these properties.
Having said that, I need to add: Why call 6 procedures from ASP? One of the
main benefits of procedures is encapsulation, a huge benefit of which is
reducing the number of round trips to the database. You should create a new
procedure which accepts all the arguments required to call the other 6
procedures. This procedure calls the 6 procedures in turn and then returns
the overall result to the ASP client. One trip to the database. This can be
a huge performance booster.
I also need to add: you need to do some work to optimize the procedures you
have. You should not be allowing an asp page to time out waiting for
database activity to complete. Is there any way to take that time-consuming
activity offline?
Bob Barrows
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"|||I'll try to answer to your question as much as I understood it.
First of all, ASP is not compiled, it is interpreted language. Ok, this has
nothing with your question but I had to say it :)
ADO Connection/Command object has CommandTimeout property which defines for
how long it will wait for SP to execute.
I did not work with ASP and ADO for a long time. I had that "luck" to switch
to .NET (c#) and ADO.NET, but from my expirience with ASP adn SPs I would
advice you to:
-Remove print commands from your SP, it may confuse ADO
-Set "set nocount on" at the beging of your code
-Close connection as soon as you finish you finish your work with DB
-Use SQL OLE DB provider for SQL Server
http://msdn.microsoft.com/library/d...
qlprovspec.asp
I hope this help
Regards,
Marko Simic
"Simon McLaren" wrote:

> I am hopeful that those of you with more experience in the compilation of
> .asp, the connection object and MS SQL Server as the DB can help me out. I
> have a web app that routinely calls stored procedures in a MS SQL DB.
> In one web page, I make 6 calls with the Connection.Execute 'store
> procedure'. Five of the six calls execute as expected. However; I have one
> call in middle of the 6 that only executes the stored procedure partially.
> This particular stored procedure does quite a bit of work within the DB, m
ake
> 3-4 select quiries and then a few updates to a single record. In this
> procedure, one of SQL update statements is constructed in a loop to ensure
> the appropriate fields are updated and no others. (The fields updated vary
> with the input being used) This is where the procedure will "time out".
I
> have reduce/elimnated all the "debuggin" code that is no esential to the
> store procedure. When the dubbuging print and select statements commented
> out the procedure will execute further when called from the asp page.
> Has anyone run across a situation where the .asp does not allow a stored
> procedure to execute to completion before executing the next line of .asp
> code? If so is there a way to force the Connection.Execute call to wait un
til
> the SQL server stored procedure has completed executing before processing
the
> next line of asp? Note the stored procedure does not explicitly return
> anything to the asp code... also noteworthy, if the same stored procedure
is
> run from the SQL Query Analyzer (a tool for MS SQL Server) the stored
> procedure runs flawlessly and as expected to completion...
> Anyone have an idea?
>|||Bob and Simic,
Thanks for taking the time to respond. Bob to answer you question about why
the 6 SP calls... Originally it the six where all one procedure.
Progromatically, the six procedures achimplish "steps" of a process, all of
which in this application could be (and are) occassionally executed
independently. I have created an encapsulating SP that in turn calls the 6
seperate SP's, but this non-completion issue forced me to back away from tha
t
idea to try and isolate the "offending" procedure.
The Connection/Command timeouts have been set to 60seconds. This failure
happens much quicker than 60 seconds.
By trial and error last w I tried commenting out all "debugging" code (to
include print and select statement indented to allow me to see what was
happening and if dynamicly generated SQL statements where correct.) in the
offending stored procedure, figuring not that it might be confusing ADO, but
rather that is was adding to the execution time of the stored procedure. An
d
presto, execution to completion for the .asp page and no debuggin "insight"
from the query analyzer.
While I "stumbled" across the issue on my own, it was not until reading your
responses that I understood what the actual issue was. With "debugging code
"
commented out of the stored procedures, I believe I can move back to a singl
e
SP and trip to the database.
Thanks,
Simon
"Simic Marko" wrote:
> I'll try to answer to your question as much as I understood it.
> First of all, ASP is not compiled, it is interpreted language. Ok, this ha
s
> nothing with your question but I had to say it :)
> ADO Connection/Command object has CommandTimeout property which defines fo
r
> how long it will wait for SP to execute.
> I did not work with ASP and ADO for a long time. I had that "luck" to swit
ch
> to .NET (c#) and ADO.NET, but from my expirience with ASP adn SPs I would
> advice you to:
> -Remove print commands from your SP, it may confuse ADO
> -Set "set nocount on" at the beging of your code
> -Close connection as soon as you finish you finish your work with DB
> -Use SQL OLE DB provider for SQL Server
> http://msdn.microsoft.com/library/d...sqlprovspec.asp
> I hope this help
> Regards,
> Marko Simic
>
> "Simon McLaren" wrote:
>

connection with sql server through asp.net

hi every body,

i find problems in connection string to connect with sql server through asp.net. the error is unknown connection option in connection string.

the connection string i have used is:

dim cnn as sqlconnection = new sqlconnection()

sqlcnn.ConnectionString = "datasource=arun;initialcatalog = reporting system;"

here arun is server name;reporting system is database

anyone help me

I think it's "initial catalog" instead of "initialcatalog". Take a look at following link for various connection string related info.

http://www.connectionstrings.com/

|||

hi,

take u for ur help. now i got the solution

Connection Using Gobal ASP

I am having trouble connecting to my SQL Server. I am using InterDev and mod
ifing the gobal.asp.
This is the code I am using
application("DBConn")="Provider=SQLOLEDB;User ID=sa;Initial Catalog=northwin
d;Data Source=192.168.20.17;PASSWORD=;"
Is this correct? If not what should I modify?What errors do you receive? That might help us provide an answer.
First off, I would not use the 'sa' account for a web app.
Create a separate SQL Server login (with limited permissions) and use =
that.
Secondly, you should probably have a password on the account that you =
are using. I am guessing that you may have left that piece out of your =
post because you did not want to tell us your sa password.
Thirdly, do you want the initial database to be northwind?
--=20
Keith
"Jack Temple" <anonymous@.discussions.microsoft.com> wrote in message =
news:9A428A01-1348-4F81-B46B-511CC98ACF0B@.microsoft.com...
> I am having trouble connecting to my SQL Server. I am using InterDev =
and modifing the gobal.asp.
>=20
> This is the code I am using=20
>=20
> application("DBConn")=3D"Provider=3DSQLOLEDB;User ID=3Dsa;Initial =
Catalog=3Dnorthwind;Data Source=3D192.168.20.17;PASSWORD=3D;"
>=20
> Is this correct? If not what should I modify?
>=20
>

Connection to Sql-Server

Hi,

I'm a newbie at the asp.net site.
The things i have done where with access.
But now i want to use Sql-server

In access i used this to execute a query:

*** In the global.asax ***
session("dbpath") = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=" + Server.MapPath("\db\MediaProject.mdb")

*** Return dataSet ***
ResultDS = GetSql(SqlStatement, session("dbpath"))
Dim ResultDS AS system.data.dataset

*** Lib file: ***
Function GetSQL(a As string, b as string) As System.Data.DataSet
Dim connectionString As String = b
Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)
Dim queryString As String = a
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection

Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)

The question now is wich string do i now have to put in the session("dbpath") ?
Which is the Provider?
How does the string looks like.
Or do i use something else now ?

Many thanx in advance


oSQLConn.ConnectionString = "Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=mySQLServerDBName;" & _
"User ID=myUsername;" & _
"Password=myPassword"

Connection to SQL server Help SOS

I have SQL Server2000 installed on my PC when I am trying to do some programs in ASP.NET application. I have serious problem working with the SQL server 2000.Whenever I use visual tools to connect to the server or manually. Explorer returns error
//////////////////////////////////////////////////////////////////////////////////////////////
Server Error in '/ASP.NetPage530' Application.

Login failed for user 'ZEUS\ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'ZEUS\ASPNET'.

Source Error:

Line 88: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 89: If Not IsPostBack Then
Line 90: SqlDataAdapter1.Fill(DsCustID1, "Customers")
Line 91: DataBind()
Line 92: End If

Source File: C:\Inetpub\wwwroot\ASP.NetPage530\WebForm1.aspx.vb Line: 90

Stack Trace:

[SqlException: Login failed for user 'ZEUS\ASPNET'.]
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
ASP.NetPage530.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\ASP.NetPage530\WebForm1.aspx.vb:90
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
////////////////////////////////////////////////////////////////////////////////////////////////////////
No errors exist when I work with windows application both in ACCESS or SQL SERVER Databases and no errors exists when I am using access files in asp.net applicationand in both cases i use Windows NT Integrated Security .Most probably I need to configure my IIS5.0 but how I have no idea
Can anyone help?You may need to grant 'ZEUS\ASPNET' login permissions to your SQL Server. You can do this directly in SQL Server Enterprise Manager if you have it. Otherwise, you will need to use SQL language by running osql.exe from the command line.|||Yes but in command promt it asks for a password I have only one one pasword is system password which is invalid in command promt for osql.exe how i can configure it ?please help|||Type osql /? at the command line.

This gives you a list of parameters you can use to run the program.

I think you can use the-E parameter for a trusted connection.|||Thank you trying help me but I have no idea how to use –E parameters
I have tried the following command in command prompt osql/E the output was the number 1 what it means I don't know pushing the enter gives 2 and etc
what i have to do to enable trusted connections ???|||
If you are seeing this:

1
That means you are logged in succesfully.

Now you can execute any SQL statement. Each statement can consist of multiple lines. When you are finished, typeGO on a new line and hit enter. For Example (type enter at the end of each line):

1>Select name
2>From sysxlogins
3>go

This will display a list of current logins for your database.

What you need to do next is find some documentation on SQL language on how to add logins and grant them access to databases and database objects.

Have a look here for granting an NT user login permissions:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_ga-gz_8dri.asp

If you like, you can go here for security in general:http://msdn.microsoft.com/library/en-us/adminsql/ad_security_05bt.asp?frame=true

I hope this helps.

Connection to SQL Server database

I keep on getting an error when I try to connect to my database throuh my ASP.NET WEb application. The error says login failed for user...

Initially I was using Windows Authentication with Impersonation turned on. This let me connect to the database no problem.

However, I decided to change my method of connecting to the database for performance reasons but now I get this error.

I store my connection string in web.config and it looks like this:


<appSettings>
<add key="ConnectionString" value="server=server;
Database=dbname;Connect Timeout=15;Network Library=dbmssocn;uid=username;password=userpassword"/>
</appSettings>

Further down in the web.config file I still have this:


<authentication mode="Windows" /
<authorization>
<allow users="nameofusergroup" />
<deny users="?" />
</authorization
<identity impersonate="true" />

Any ideas why I would be able to connect to the database using impersonation and not when I explicity give the crudentials in the connection string?

Regards

Wallaceprobably SQL Server isn't configured for SQL Authentication. just windows.

Thursday, March 8, 2012

Connection to SQL Server 2000 thinks it is 2005

Hi
I have a SQL Server 2000 database that I can connect to from an ASP.NET web
site quite happily. Using the same connection string in a Windows Forms
application I get the message "When connecting to SQL Server 2005, this
failure may be caused by the fact that under the default settings SQL Server
does not allow remote connections. (provider: Named Pipes Provider, error: 40
- Could not open a connection to SQL Server").
Please could anyone advise.
Marek
Hi
It does not think it is SQL Server 2005 ("when"), but gives additional
information, in case you are trying to connect to SQL Server 2005. Part of
the enhanced error information that helps with troubleshooting.
Have you tried connecting though TCP/IP (adding "Network Library=DBMSSOCN"
to your connection string)?
You web server might be configured differently. Running cliconfg.exe on your
machine will allow you to configure the default library.
Regards
Mike
This posting is provided "AS IS" with no warranties, and confers no rights.
"Marek" <mav@.community.nospam> wrote in message
news:B89D86BB-AF20-4E90-89AE-C690A07BC232@.microsoft.com...
> Hi
> I have a SQL Server 2000 database that I can connect to from an ASP.NET
> web
> site quite happily. Using the same connection string in a Windows Forms
> application I get the message "When connecting to SQL Server 2005, this
> failure may be caused by the fact that under the default settings SQL
> Server
> does not allow remote connections. (provider: Named Pipes Provider, error:
> 40
> - Could not open a connection to SQL Server").
> Please could anyone advise.
> Marek

Connection to SQL Server 2000 thinks it is 2005

Hi
I have a SQL Server 2000 database that I can connect to from an ASP.NET web
site quite happily. Using the same connection string in a Windows Forms
application I get the message "When connecting to SQL Server 2005, this
failure may be caused by the fact that under the default settings SQL Server
does not allow remote connections. (provider: Named Pipes Provider, error: 4
0
- Could not open a connection to SQL Server").
Please could anyone advise.
MarekHi
It does not think it is SQL Server 2005 ("when"), but gives additional
information, in case you are trying to connect to SQL Server 2005. Part of
the enhanced error information that helps with troubleshooting.
Have you tried connecting though TCP/IP (adding "Network Library=DBMSSOCN"
to your connection string)?
You web server might be configured differently. Running cliconfg.exe on your
machine will allow you to configure the default library.
Regards
--
Mike
This posting is provided "AS IS" with no warranties, and confers no rights.
"Marek" <mav@.community.nospam> wrote in message
news:B89D86BB-AF20-4E90-89AE-C690A07BC232@.microsoft.com...
> Hi
> I have a SQL Server 2000 database that I can connect to from an ASP.NET
> web
> site quite happily. Using the same connection string in a Windows Forms
> application I get the message "When connecting to SQL Server 2005, this
> failure may be caused by the fact that under the default settings SQL
> Server
> does not allow remote connections. (provider: Named Pipes Provider, error:
> 40
> - Could not open a connection to SQL Server").
> Please could anyone advise.
> Marek

Connection to SQL Server 2000 From an ASP Page

Dear All,
I'm really confusing while reading the connections Issue in the support
knowledge.
Our Company website guest users can register themselves in my website. The
data goes to the SQL Server database 2000 which also used by internal users
of my company as Inhouse Database. So I want to restrict the Website Guest
users. Whats the safest way to connect to?.
Actually MY IIS SQL Server running on different machine(as stated in
support base)
1. I have created windows user a/c (say WEBUSER) on both machines with the
same password.
2. I have created a login a/c SQL Server for WEBUSER too.
But unfortunately I am getting "Internal Server Error" - Page Can not be
Displayed.
My connection String is as follows:
dc0.Open "Provider=sqloledb;" & _
"Network Library=DBNETLIB;" & _
"Integrated Security=SSPI." & _
"Data Source=ServerName;" & _
"Initial Catalog=DatabaseName;" & _
"User ID=UserName;" & _
"Password=password"
Please advice me is this safe?. Why I'm getting the error?
Thanks
Kavi
As a first step, try the following:
Log onto SQL Query Analyser and log on with the DataSource/username/password
that is used withing your connection string.
If this is OK , simulate a SQL statement that is similar that will run by a
web user.
At this point, you'll know that the account is OK.
can you connect , for example, via telnet to the sql server?
Are other pages running on the web server.
Also, see if you can trap the error and print it on the page.
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
"Kavi" <Kavi@.discussions.microsoft.com> wrote in message
news:FA375A40-B27B-44DE-9584-7CC8B781AFE1@.microsoft.com...
> Dear All,
> I'm really confusing while reading the connections Issue in the support
> knowledge.
> Our Company website guest users can register themselves in my website. The
> data goes to the SQL Server database 2000 which also used by internal
users
> of my company as Inhouse Database. So I want to restrict the Website Guest
> users. Whats the safest way to connect to?.
> Actually MY IIS SQL Server running on different machine(as stated in
> support base)
> 1. I have created windows user a/c (say WEBUSER) on both machines with
the
> same password.
> 2. I have created a login a/c SQL Server for WEBUSER too.
> But unfortunately I am getting "Internal Server Error" - Page Can not be
> Displayed.
> My connection String is as follows:
> dc0.Open "Provider=sqloledb;" & _
> "Network Library=DBNETLIB;" & _
> "Integrated Security=SSPI." & _
> "Data Source=ServerName;" & _
> "Initial Catalog=DatabaseName;" & _
> "User ID=UserName;" & _
> "Password=password"
> Please advice me is this safe?. Why I'm getting the error?
> Thanks
> Kavi
>
|||Thanks Jack. I'll try.
"Jack Vamvas" wrote:

> As a first step, try the following:
> Log onto SQL Query Analyser and log on with the DataSource/username/password
> that is used withing your connection string.
> If this is OK , simulate a SQL statement that is similar that will run by a
> web user.
> At this point, you'll know that the account is OK.
> can you connect , for example, via telnet to the sql server?
> Are other pages running on the web server.
> Also, see if you can trap the error and print it on the page.
>
> --
> Jack Vamvas
> ___________________________________
> Receive free SQL tips - www.ciquery.com/sqlserver.htm
>
> "Kavi" <Kavi@.discussions.microsoft.com> wrote in message
> news:FA375A40-B27B-44DE-9584-7CC8B781AFE1@.microsoft.com...
> users
> the
>
>
|||In the Advanced tab of Internet Options of IE, uncheck "Show friendly
HTTP error messages". Then you usually can see the whole error
message.
Shane

Connection to SQL Server 2000 From an ASP Page

Dear All,
I'm really confusing while reading the connections Issue in the support
knowledge.
Our Company website guest users can register themselves in my website. The
data goes to the SQL Server database 2000 which also used by internal users
of my company as Inhouse Database. So I want to restrict the Website Guest
users. Whats the safest way to connect to?.
Actually MY IIS SQL Server running on different machine(as stated in
support base)
1. I have created windows user a/c (say WEBUSER) on both machines with the
same password.
2. I have created a login a/c SQL Server for WEBUSER too.
But unfortunately I am getting "Internal Server Error" - Page Can not be
Displayed.
My connection String is as follows:
dc0.Open "Provider=sqloledb;" & _
"Network Library=DBNETLIB;" & _
"Integrated Security=SSPI." & _
"Data Source=ServerName;" & _
"Initial Catalog=DatabaseName;" & _
"User ID=UserName;" & _
"Password=password"
Please advice me is this safe?. Why I'm getting the error?
Thanks
KaviAs a first step, try the following:
Log onto SQL Query Analyser and log on with the DataSource/username/password
that is used withing your connection string.
If this is OK , simulate a SQL statement that is similar that will run by a
web user.
At this point, you'll know that the account is OK.
can you connect , for example, via telnet to the sql server?
Are other pages running on the web server.
Also, see if you can trap the error and print it on the page.
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
"Kavi" <Kavi@.discussions.microsoft.com> wrote in message
news:FA375A40-B27B-44DE-9584-7CC8B781AFE1@.microsoft.com...
> Dear All,
> I'm really confusing while reading the connections Issue in the support
> knowledge.
> Our Company website guest users can register themselves in my website. The
> data goes to the SQL Server database 2000 which also used by internal
users
> of my company as Inhouse Database. So I want to restrict the Website Guest
> users. Whats the safest way to connect to?.
> Actually MY IIS SQL Server running on different machine(as stated in
> support base)
> 1. I have created windows user a/c (say WEBUSER) on both machines with
the
> same password.
> 2. I have created a login a/c SQL Server for WEBUSER too.
> But unfortunately I am getting "Internal Server Error" - Page Can not be
> Displayed.
> My connection String is as follows:
> dc0.Open "Provider=sqloledb;" & _
> "Network Library=DBNETLIB;" & _
> "Integrated Security=SSPI." & _
> "Data Source=ServerName;" & _
> "Initial Catalog=DatabaseName;" & _
> "User ID=UserName;" & _
> "Password=password"
> Please advice me is this safe?. Why I'm getting the error?
> Thanks
> Kavi
>|||Thanks Jack. I'll try.
"Jack Vamvas" wrote:

> As a first step, try the following:
> Log onto SQL Query Analyser and log on with the DataSource/username/passwo
rd
> that is used withing your connection string.
> If this is OK , simulate a SQL statement that is similar that will run by
a
> web user.
> At this point, you'll know that the account is OK.
> can you connect , for example, via telnet to the sql server?
> Are other pages running on the web server.
> Also, see if you can trap the error and print it on the page.
>
> --
> Jack Vamvas
> ___________________________________
> Receive free SQL tips - www.ciquery.com/sqlserver.htm
>
> "Kavi" <Kavi@.discussions.microsoft.com> wrote in message
> news:FA375A40-B27B-44DE-9584-7CC8B781AFE1@.microsoft.com...
> users
> the
>
>|||In the Advanced tab of Internet Options of IE, uncheck "Show friendly
HTTP error messages". Then you usually can see the whole error
message.
Shane

connection to sql server

Hi,

Im using asp code. how to i connect to sql server. could anyone provide me the coding to connect. and how to setup the connection.Hi
You can find the resources Here or Here|||hi,

im using this coding for the connection to sql server

<%
Set demoConn = Server.CreateObject("ADODB.Connection")
demoPath="DRIVER={SQLServer};" & _
"SERVER=servername;UID=username;" & _
"PWD=password;DATABASE=database"
demoConn.open demoPath
%>

but still couldnt, is there any setup that i have to do. something like odbc setup or any else setup. thanks

connection to SQL from asp.net page

I am using an asp.net page with vb.net. The following connection in my web.config file will connect the database to my page no problem:

"Data Source=MIAPPS1;Initial Catalog=MASTER_DB;Integrated Security=SSPI;"

However, when I add data to the page and try to preview it in the browser I get the following error:

"System.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."

I'm kind of perplexed as to why I can attach a database to my page, test the connection view data -but not be able to connect when previewing through the browser.

Any Ideas?

BillHave you added the ASP.NET account to the server server authorized logins?|||I have added an account ASPNET. Is it ASPNET or ASP.NET. The error message also showed, null for the login, does this still point to the ASPNET login issue?|||Yes. The errors means that you either trying to connected to SQL with SQL Authication while only Windows Authentication is enabled, or that the windows account you're using is not one enlisted into the sql logins account.

If you're using IIS5 the account is ASP.NET, if using IIS6 is the Network Service account

connection to MSDE from WebMatrix

Hi,

I've just started to learn ASP.net using Scott Mitchell's book:ASP.NET in 24 hours. But i've got a little problem in the database section.
I couldn't connect with a MSDE from webmatrix using sql server authentication even the username and password are correct.
The error message :
"unable to connect to the database server:Login failed for user 'sa'. Reason:not associated with a trusted SQL server connection".
What does it mean? Have any of you ever had this kind of problem?
Thank you for helping me.

Regards,
tomhi!

the sa user is SysAdmin ;) the password and login authentification depends on how you set up your MSDE. what parameters have you used at the msde setup?

i'm not sure why some sql-requests require a trusted connection but it seems that if you use windows authentification you can connect to the db-server..
so the windows login seems to be a "trusted connection" but maybe you have to use the SSPI for the sql-login, just an idea how you could try to solve this ;)

hth, greetz

i might be wrong as i started learning about asp.net and sql some days ago too ^^ if that's the case plz correct me|||By default MSDE is installed with Windows Authentication only. You will have to change to mixed mode. That is my first guess on this one (may come back and edit this later with more info).