Showing posts with label net. Show all posts
Showing posts with label net. 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

Tuesday, March 20, 2012

connections to MSDE with .net installed

Hi,
Does the .net framework take up a connection to MSDE when starting up? We
are experiencing the following scenario:
Start up computer
Start our program that uses MSDE and the .net framework
Runs very slow
Shut down program on all computers
Stop MSDE service and Start again and it runs fine.
The reason I ask about the .net framework is that our program ran fine
before we migrated it to .net.
It seems like the govenor kicks in as soon as the machine is started - maybe
..net checks liscences or something?
..Net does not automatically take up connections or check licenses to MSDE or
any other DBMS. Run SQL Profiler (you have the Developers Edition of SQL
Server, don't you?) and see if any unexpected connections are being made to
the MSDE instance.
Jim
"Andrew" <Andrew@.discussions.microsoft.com> wrote in message
news:BF7838CC-CC14-4953-82A4-280A7B8213F7@.microsoft.com...
> Hi,
> Does the .net framework take up a connection to MSDE when starting up? We
> are experiencing the following scenario:
> Start up computer
> Start our program that uses MSDE and the .net framework
> Runs very slow
> Shut down program on all computers
> Stop MSDE service and Start again and it runs fine.
> The reason I ask about the .net framework is that our program ran fine
> before we migrated it to .net.
> It seems like the govenor kicks in as soon as the machine is started -
maybe
> .net checks liscences or something?

connections from app

Hi All,
I need a help from experts. We have an vb.net app using sqlserver.
I review the app and I saw a function declaring a connection, open, execute
sp and close. This app runs once a day for couple of minutes.
Now I suggest that this app should have one defined connection and in the
program we can open and close de connection many times. But the developer
keep saying that it doesn't matter.
My question is how is the best way to handle connections inside of an app in
a way to use better the resource of sqlserver server?
I hope this is enough description for you.
Tks in advance.
JohnnyBest practice is to open a connection as late as possible before you use it,
and close it as early as possible after you have finished with it.
This does not mean the you need to destroy and re-create the objects used to
access the DB or that you should close the connection between each operation
in a serial chain of database commands, just dont leave a connection open if
your application is idle.
Mr Tea
"JFB" <help@.jfb.com> wrote in message
news:%234dogSmLFHA.700@.TK2MSFTNGP10.phx.gbl...
> Hi All,
> I need a help from experts. We have an vb.net app using sqlserver.
> I review the app and I saw a function declaring a connection, open,
> execute
> sp and close. This app runs once a day for couple of minutes.
> Now I suggest that this app should have one defined connection and in the
> program we can open and close de connection many times. But the developer
> keep saying that it doesn't matter.
> My question is how is the best way to handle connections inside of an app
> in
> a way to use better the resource of sqlserver server?
> I hope this is enough description for you.
> Tks in advance.
> Johnny
>

Monday, March 19, 2012

Connectiong problem Sqlserver 2005 Express

I'm working with an Sqlserver 2005 Express database on my local machine, and using vs.net 2005.I need to enable the sqlserver cache by the way:

aspnet_regsql -E -d Northwind -ed

I encountered the remote connection problem(error:40).The northwind database was restored to the sqlserver 2005 express by the db file downloaded,and I added the ASPNET user.I also enabled the TCP/IP by using SQL Server Configuration Manager.

But all the web application connected to the Northwind database is working through the connection string:

"Data Source=WKS-DEV-04\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True"

Any help will be much appreciated, thank you very much for reading my post

Can you telnet to the remote SQL Express service from the client? Using such command from commandline:

telnet xxx.xx.xx.xxx yyyy

Where Xs stand for ip address of the remote server, and Ys stand for TCP port of the service. You can check the TCP port of the SQL service in 'SQL Server Configuration Manager'->SQL Server 2005 Network Configuration

|||Thank you for your reply very much.I have got it done.

Sunday, March 11, 2012

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 Trusted with Windows98

Hi everybody,
we just developed a standalone application using .NET+ C# + MSDE.
So, we're working to get a setup installation in order to deploy our
application for Windows2000/NT/XP/98 Opertaing System.
At the moment we're making some test on W/98 machine but we've got some
problems:
MSDE has been installed with flag SECURITYMODE=SQL allowing connection
trusted. In fact, after installation by W/XP we're able to connect to db
with OSQL command with -E option and with our application specifying
Integrated Security=SSPI in ConnectionString.
We don't have the same behaviour on Windows98 Operating System.
In spite of the flag mentioned above in installation I can using a
connection trusted.
Any suggestion ?
Thanks in advance, Pierluigi.
hi Pierluigi,
"Pierluigi Terzoli" <pierluigi_terzoli@.hotmail.com> ha scritto nel messaggio
news:eguAq2PZEHA.2816@.TK2MSFTNGP11.phx.gbl...
> Hi everybody,
> we just developed a standalone application using .NET+ C# + MSDE.
> So, we're working to get a setup installation in order to deploy our
> application for Windows2000/NT/XP/98 Opertaing System.
> At the moment we're making some test on W/98 machine but we've got some
> problems:
> MSDE has been installed with flag SECURITYMODE=SQL allowing connection
> trusted. In fact, after installation by W/XP we're able to connect to db
> with OSQL command with -E option and with our application specifying
> Integrated Security=SSPI in ConnectionString.
> We don't have the same behaviour on Windows98 Operating System.
> In spite of the flag mentioned above in installation I can using a
> connection trusted.
> Any suggestion ?
> Thanks in advance, Pierluigi.
>
I don't know if I correctly undertand your question...
SECURITYMODE=SQL stands for supporting both trusted WinNT connections as SQL
Server authenticated connections...
trusted connections are available only when MSDE(SQL Server) is installed on
WinNT platform... Win9x boxes only allow standard SQL Server authenticated
connections
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Yes Andrea,
you understood right and you gave me the right answer.
I'm sorry, but I don't realise that trusted connection concept is valid with
WinNT only (I suppose even for WinXP, of course).
So, it means if I want to have a application .net+msde who wants to run on
all MS Operating System including W/98 I MUST use a SQL autentication.
Right ?
We've to consider this fact on the setup routine and in the Connection
String specified inside the C# application.
Thanks so much, Pierluigi.
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> ha scritto nel messaggio
news:2l59icF8qs72U1@.uni-berlin.de...
> hi Pierluigi,
> "Pierluigi Terzoli" <pierluigi_terzoli@.hotmail.com> ha scritto nel
messaggio
> news:eguAq2PZEHA.2816@.TK2MSFTNGP11.phx.gbl...
> I don't know if I correctly undertand your question...
> SECURITYMODE=SQL stands for supporting both trusted WinNT connections as
SQL
> Server authenticated connections...
> trusted connections are available only when MSDE(SQL Server) is installed
on
> WinNT platform... Win9x boxes only allow standard SQL Server authenticated
> connections
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||hi Pierluigi,
"Pierluigi Terzoli" <pierluigi_terzoli@.hotmail.com> ha scritto nel messaggio
news:e9XFykQZEHA.1656@.TK2MSFTNGP09.phx.gbl...
> Yes Andrea,
> you understood right and you gave me the right answer.
> I'm sorry, but I don't realise that trusted connection concept is valid
with
> WinNT only (I suppose even for WinXP, of course).
> So, it means if I want to have a application .net+msde who wants to run on
> all MS Operating System including W/98 I MUST use a SQL autentication.
yep... MSDE must be installed on WinNT platform to take advantage of trusted
connections... the clients can be installed on all OS supported by .Net
thought...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Thanks again, Andrea.
Tomorrow we'll start working to use SQL autentication by our application,
supporting in this manner even W/98 platform.
So, we'll install MSDE on our instance with our user/pwd.
We'll use the parameters above in any ConnectionString on our application.
Have a good day, bye, Pierluigi.
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> ha scritto nel messaggio
news:2l5c5dF8l8f7U1@.uni-berlin.de...
> hi Pierluigi,
> "Pierluigi Terzoli" <pierluigi_terzoli@.hotmail.com> ha scritto nel
messaggio[vbcol=seagreen]
> news:e9XFykQZEHA.1656@.TK2MSFTNGP09.phx.gbl...
> with
on
> yep... MSDE must be installed on WinNT platform to take advantage of
trusted
> connections... the clients can be installed on all OS supported by .Net
> thought...
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>

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.

Connection To SQL Server 2005 / 2000

Hi everybody,
I got a bit of a problem with my connection. I wrote a programm in VB.Net wich connects to a sql-server 2005. On my local Computer everything works great, but on another Computer in the Network, I just receving timeouts. I allready check, if the sever allows remote connection.
My connectionstring for the SQL connection looks like this:

"Initial Catalog=Bauvorhaben;Data Source=P4-2400\SQLEXPRESS;Password=?;Persist Security Info=True;User ID=Lars"

I allready tried to get an connection to SQL-Server 2000. But the same here.

Does somebody have a clue, why I can't connect?

Thanks,
Lars

By default SQLExpress do not allow remote conneciton.

You need to

1. Turn on remote connection using SQL Server configuration Manager.

2. Start sqlbrowser service that is collocated with the SQLExpress server. SQL Browser service is needed if the sqlserver is a name instance, such as sqlexpress.

3. Make sure you make exception for sqlservr.exe in the firewall configuration of windows.

http://blogs.msdn.com/sql_protocols/archive/2005/11/14/492616.aspx

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 remote server

I'm using vb.net to connect to a MSDE 2000 database on a remote server.
While in VB.NET, I'm able to view data using Server Explorer. In addition,
I've configured an ODBCDATAADAPTER that fills the dataset under preview data.
When I tried to retrieve data through webform/datagrid I get the error
"ERROR [08001] [Microsoft][ODBC SQL Server Driver][Named Pipes]SQL Server
does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server
Driver][Named Pipes]ConnectionOpen (Connect())."
I created a system dsn to connect to remote server. Test connection
succeeded. Any ideas what's wrong?
Hutty
The connection string I'm using in vb.net is
Dim Conn As New SqlConnection("Persist Security Info=False;Data
Source=INTL_INSTANCE;Extended
Properties=DSN=INTL_INSTANCE;UID=Hutty;APP=Microso ft? Visual Studio
..NET;WSID=CUI0113;DATABASE=Hutty;Network=DBNMPNTW ;Address=\\INTL\pipe\MSSQL$MYINSTANCE\sql\query;Tr usted_Connection=Yes;Initial Catalog=Hutty")
Hutty
"Hutty" wrote:

> I'm using vb.net to connect to a MSDE 2000 database on a remote server.
> While in VB.NET, I'm able to view data using Server Explorer. In addition,
> I've configured an ODBCDATAADAPTER that fills the dataset under preview data.
> When I tried to retrieve data through webform/datagrid I get the error
> "ERROR [08001] [Microsoft][ODBC SQL Server Driver][Named Pipes]SQL Server
> does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server
> Driver][Named Pipes]ConnectionOpen (Connect())."
> I created a system dsn to connect to remote server. Test connection
> succeeded. Any ideas what's wrong?
> --
> Hutty
|||I have the same problem.
I want to connect to a SQL server with this connection string:
Dim Conn As New SqlConnection( "Data Source=83.240.161.155;
User Id=sa;password=;Initial Catalog=Avaliacao Desempenho")
Any help?
Ze
"Hutty" wrote:
[vbcol=seagreen]
> The connection string I'm using in vb.net is
> Dim Conn As New SqlConnection("Persist Security Info=False;Data
> Source=INTL_INSTANCE;Extended
> Properties=DSN=INTL_INSTANCE;UID=Hutty;APP=Microso ft? Visual Studio
> .NET;WSID=CUI0113;DATABASE=Hutty;Network=DBNMPNTW; Address=\\INTL\pipe\MSSQL$MYINSTANCE\sql\query;Tru sted_Connection=Yes;Initial Catalog=Hutty")
> --
> Hutty
>
> "Hutty" wrote:

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