Showing posts with label net. Show all posts
Showing posts with label net. Show all posts

Friday, March 30, 2012

Remove Grand Total in Pivot Table issue using asp.net

Hi,

I am trying to remove the grad total amount from the pivot table list with asp.net,programing. The data I called from cube, I have rows,columns and data axis values, when I place my measure in to data axis it autometically created sub total and grand totals, I want remove those. I could not found any property or method to remove that.

Please help me on this.

Hi Please help, I still not got any answer.

Friday, March 23, 2012

Remote User

Hi, im new to here and SQL server.

I am building a program in vb.net 2005 as a booking system using SQL server as backend. I have just finally managed to get SQL server working on the server, DIY Windows XP Server, but I cannot make remote logins. I have my client computers connected through a workground called JNKVPN. I can connect to all the client computers on the network through the workgroup computers menu off network places. I want to add a remote user account to SQL Server management studio express but none of the client computers are listed as domains.

Is there any way I can get them listed. I have been getting very fustrated with this and i need to have the program i am writing completed by 28th Sept 2007 so this is really delaying me substatially.

Thanks in advance for reply's

Regards
Matt

Hi,

As you said your machines are not on domain network, so you can not add the windows users to your server, rather you may add sql server login(s) in this case. Add the machine(s) to doamains so that they appears or else you need to create a windows login on your sql server machine with the same user id /password as they are on your workgroup machine. I.E. the name of your machine on workgroup is MachA and it has a user "squser1" and password "squser1", you need to create a windows user on your sql server with same username "squser1" and password "squser1" , But the best bet is to add those machine on your domain and then add/map the users to your sql server.

|||

Hi, thanks for your reply.

You have said

Hemantgiri S. Goswami wrote:

Add the machine(s) to doamains so that they appears

This is what I want to know how to do.

In theory should the workgroup computers automatically be added to the listed locations on the add login window or is there a process I must go through to get them on there. As I stated before I can see the other computers in the network places > view workgroup computers.

Regards

Matt

|||I have solved my problem. I was trying to add sql user with windows domain and account details and it was throwing an error at this. This post just illustrates my inexperience with SQL.

Thanks anyway for the reply

Remote User

Hi, im new to here and SQL server.

I am building a program in vb.net 2005 as a booking system using SQL server as backend. I have just finally managed to get SQL server working on the server, DIY Windows XP Server, but I cannot make remote logins. I have my client computers connected through a workground called JNKVPN. I can connect to all the client computers on the network through the workgroup computers menu off network places. I want to add a remote user account to SQL Server management studio express but none of the client computers are listed as domains.

Is there any way I can get them listed. I have been getting very fustrated with this and i need to have the program i am writing completed by 28th Sept 2007 so this is really delaying me substatially.

Thanks in advance for reply's

Regards
Matt

Hi,

As you said your machines are not on domain network, so you can not add the windows users to your server, rather you may add sql server login(s) in this case. Add the machine(s) to doamains so that they appears or else you need to create a windows login on your sql server machine with the same user id /password as they are on your workgroup machine. I.E. the name of your machine on workgroup is MachA and it has a user "squser1" and password "squser1", you need to create a windows user on your sql server with same username "squser1" and password "squser1" , But the best bet is to add those machine on your domain and then add/map the users to your sql server.

|||

Hi, thanks for your reply.

You have said

Hemantgiri S. Goswami wrote:

Add the machine(s) to doamains so that they appears

This is what I want to know how to do.

In theory should the workgroup computers automatically be added to the listed locations on the add login window or is there a process I must go through to get them on there. As I stated before I can see the other computers in the network places > view workgroup computers.

Regards

Matt

|||I have solved my problem. I was trying to add sql user with windows domain and account details and it was throwing an error at this. This post just illustrates my inexperience with SQL.

Thanks anyway for the reply

Remote User

Hi, im new to here and SQL server.

I am building a program in vb.net 2005 as a booking system using SQL server as backend. I have just finally managed to get SQL server working on the server, DIY Windows XP Server, but I cannot make remote logins. I have my client computers connected through a workground called JNKVPN. I can connect to all the client computers on the network through the workgroup computers menu off network places. I want to add a remote user account to SQL Server management studio express but none of the client computers are listed as domains.

Is there any way I can get them listed. I have been getting very fustrated with this and i need to have the program i am writing completed by 28th Sept 2007 so this is really delaying me substatially.

Thanks in advance for reply's

Regards
Matt

Hi,

As you said your machines are not on domain network, so you can not add the windows users to your server, rather you may add sql server login(s) in this case. Add the machine(s) to doamains so that they appears or else you need to create a windows login on your sql server machine with the same user id /password as they are on your workgroup machine. I.E. the name of your machine on workgroup is MachA and it has a user "squser1" and password "squser1", you need to create a windows user on your sql server with same username "squser1" and password "squser1" , But the best bet is to add those machine on your domain and then add/map the users to your sql server.

|||

Hi, thanks for your reply.

You have said

Hemantgiri S. Goswami wrote:

Add the machine(s) to doamains so that they appears

This is what I want to know how to do.

In theory should the workgroup computers automatically be added to the listed locations on the add login window or is there a process I must go through to get them on there. As I stated before I can see the other computers in the network places > view workgroup computers.

Regards

Matt

|||I have solved my problem. I was trying to add sql user with windows domain and account details and it was throwing an error at this. This post just illustrates my inexperience with SQL.

Thanks anyway for the reply

Wednesday, March 21, 2012

remote sql server connection

Hi all,
I am trying to connect to remote sql server in vb.net application.
I am getting an error "login failed for user'abc' ".
why am I getting this error, what could be the possible reason.
any help will be appreciated.what is the login and password in your database?
whats ur connection string in vb.net?|||http://www.freevbcode.com/ShowCode.asp?ID=2226 a template to perform the task.

What is the connection string set and SQL server authentication?|||Originally posted by deidei76
what is the login and password in your database?
whats ur connection string in vb.net?

login: abc
password: abc

"data source=IP address of server;initial catalog=databasename;persist security info=False;user id=abc;workstation id=WSID;packet size=4096"|||Originally posted by Satya
http://www.freevbcode.com/ShowCode.asp?ID=2226 a template to perform the task.

What is the connection string set and SQL server authentication?
thanks satya.I am able to connect to the server now. simple and stupid mistake.I forgot to mention password in connection string.

Tuesday, March 20, 2012

Remote SQL admin across the internet

Hi,

What is a secure way or accepted method to make database changes,IE: edit tables, add sprocs. ect. on a server being ran by an ASP.NET hosting service across the internet?

Thank you
-heywadeYou should check out theData Access Security section of "Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication" in Microsoft's Patterns & Practices series.

Terri|||Thanks Terri,

That is a great artical. Alot of that is out of My control though. An ASP.NET hosting service said that I would use Enterprize manager to admin My "would be" database across the internet. They didn't mention using SSL, also the use of IPSec wouldn't work on My end with NAT. So I guess I'll have to follow up with them. I didn't know the SSL would work with an SQL server...cool.

Thanks again
-heywade

Monday, March 12, 2012

Remote Report Server 2005 using the reportviewer control - parameter problem

I am using an asp.net web page (C#) to access a remote Report Server via the reportviewer contol. After solving the credentials issues, all of my test reports seem to run very nicely if there is no parameter input. When a parameter report is executed, the text box for parameter input is displayed. When the parameter is entered and the View Report button is pressed, the report is NOT Returned. If I go directly to the remote Report Manager and run the report (IE no code behind), it runs as it is supposed to. I've also run the report (web page) on my local report server and it displays the report after the parameter has been input. Why is the remote report server not returning the report after the parameter is input?

Thanks,

John

This problem has been resolved. The page will not work if the "ReportViewer1.ServerReport.ReportServerCredentials = new MyReportServerCredentials();" statement is placed in the Page_Load event.

Here are the steps taken to eliminate the problem:

1. Remove the credentials statement from the Page_Load event.

2. Place this code in the Page_Load event

if (!Page.IsPostBack)
{
ReportViewer1.Visible = false;
}

3. Place a button on the page to display the report.

4. Move all report statements to the push button event. Make sure to include "ReportViewer1.Visible = true"

It now works like a champ and I am happy!

Thanks,

John

Friday, March 9, 2012

Remote MSSQL2000 server connection with .net

I have a problem in connecting to my hosting database using .net file.
I am able connect to database with my ASP page.

Any sugession is greately appretiated!

Here is my code:

".net" page:


<%@. page language='vb' debug='true' %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<html>
<script runat="server"
Sub Page_Load(Src As Object, E As EventArgs)
Dim MyConnection As SqlConnection
Dim da AS sqlDataAdaptor
Dim ds As DataSet
MyConnection = New SqlConnection("DSN=***;UID=***;PWD=***")
da = new sqlDataAdaptor("select * from city", MyConnection)
Try
MyConnection.open()
Response.write "Connection Success " & MyConnection.Database & "<br>"
catch sx AS sqlException
Response.write "Connection successful: <br>"
End Try

ds=new Dataset()
da.Fill(ds, "City")

With DataGrid1
.DataSource = ds.Tables("city").DefaultView
.DataBind()
End With

MyConnection.Close()

End Sub

</script
<body
<p>
<ASP:dataGrid id='DataGrid1' runat='server'/>
<p>
</body>
</html>
--------------


"ASP" page:

Set DB = Server.CreateObject("ADODB.Connection")
DB.Open ConnectionString

SET RSCheckeMail = DB.Execute ("select * from city")

While not RSCheckeMail.eof
Response.write "City: " & RSCheckeMail("Name") & "<br>"
RSCheckeMail.Movenext
Wend


Thanks for your help in advance.Please any help on this?|||As far as I understand it, in order to use a DSN in the connection string you have to use the ODBC provider, which is not recommended. You really need to try to use SQLClient.

Please check out the connection string suggestions athttp://www.connectionstrings.com. I would think that you would need to connect using an IP address.

Terri|||tmorton,
Thank you for your suggestion. I am trying with SQLClient only or I am missing some thing here.
I tried with all the connection strings explained in the URL: http://www.connectionstrings.com. No luck.

Any more suggestions? please.

KP|||can you post the updated code ?|||Yes, you are using SQLClient, which is good. What I was trying to say but wasn't clear is that if you want to use a DSN you would need to use ODBC instead.

Did you try a connection string in this format?
"Data Source=190.190.200.100;Network Library=DBMSSOCN;Initial Catalog=yourDatabase;User ID=yourSQLUserID;Password=youSQLUserPassword;"

If you could post your attempted connection string and any errors your are receiving this would help to troubleshoot the problem.

Terri|||tmorton,
Thank you for your advice.

I got the solution for my problem.

I think all new .net learners like me has this problem initially. I mistake I did was, not using VS .net to start my development.
All beginners you need to remember to do this when you start for the first time when you start running some sample .net pages: Create an application (vb or c#) depends as per your preference. Then add all the pages to that Application. This will make your test pages will run properly (you won't waste time like me for 3 days to scratch your head to run a simple page!!).

Here is my final code to connect remote server from your IIS:


<%@. page language='vb' %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %
<script runat="server"
Sub Page_Load(Src As Object, E As EventArgs)
Dim MyConnection As SqlConnection
Dim da AS sqlDataAdapter
Dim ds As DataSet
MyConnection = new SqlConnection("server=65.49.254.24;database=aspdotnet;uid=aspdotnetuser;pwd=aspdotnetpassword")

da = new sqlDataAdapter("select * from city", MyConnection)
Try
MyConnection.open()
Response.write ("Connection Success <br>")
catch sx AS sqlException
Response.write ("Connection failed: <br>")
End Try

ds=new Dataset()
da.fill(ds, "cities")

With DataGrid1
.DataSource = ds.Tables("cities").DefaultView
.DataBind()
End With
MyConnection.Close()
End Sub

</script>
<html>
<body
<p>
<ASP:dataGrid id='DataGrid1' runat='server'/>
<p>
</body>
</html>

Please correct me if you can improve the connection.

Thanks for your support.

KP|||this is good...works..but if you just want to display a set of results...you can use executereader (for returning multiple columns) which is faster than datasets...am sure you will learn along the journey...

in your case you could have just created an sqlcommand...xample..( off the top of my head)


dim mysqlcommand as sqlcommand
Dim conn As SqlConnection
dim strsql as string
conn="..."
strsql ="Select * from table"
mysqlcommand=new sqlcommand(strsql,conn)
conn.open()
datagrid.datasource=mysqlcommand.executereader()
conn.close()

also remember to open the connection late and close early...

hth|||Dinakar,
Thanks for your suggestions. I will remember them.
You are right! Just now I started long journey...

KP

Wednesday, March 7, 2012

Remote database Connection Error!

Hi,
My Application which is written in VB.Net uses database connection to my
Local Instance of SQL Server Express version.
My connection string is " Data
Source=SM5\SQLEXPRESS;AttachDbFilename=C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\MgmtSystem.mdf;Initial Catalog=MgmtSystem;Persist
Security Info=True;User ID=sa;Password=belmont". When I run my application
from the same machine where SQL Server instance is installed, it works fine.
But now I am intending to use it as Client-Server type as database on Server
and application running from another machine. To test this I have deployed
my application on another machine. When I run it I get following error, "An
error has occured while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the default setting SQL Server does not allow remote
connections.(provider: SQL Network Interface, error: 26 - Error Locating
Server/Instance specified)(Microsoft SQL Server Error:-1).
To Fix this I did try enabling all protocols(Shared Memory, TCP/IP, Named
Pipe). Then I even started SQL Browser service to enable the instance to be
browsed by client. Then Checked if Hide Instance property. Still no Luck.
I am really going crazy. This is really important for me since we are
migrating from Access to SQL Server Express. Since in Access my application
can have client server
Architecture. Same thing I need to have in SQL Express.
Any help is really appreciated.
Thanks,
Sujatause sql2k5 surface area configuration tool to enable 'remote connections'.
--
-oj
"Sujata P" <SujataP@.discussions.microsoft.com> wrote in message
news:94D32EEB-9098-4A51-B55D-95BD84B5AA96@.microsoft.com...
> Hi,
> My Application which is written in VB.Net uses database connection to my
> Local Instance of SQL Server Express version.
> My connection string is " Data
> Source=SM5\SQLEXPRESS;AttachDbFilename=C:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\Data\MgmtSystem.mdf;Initial
> Catalog=MgmtSystem;Persist
> Security Info=True;User ID=sa;Password=belmont". When I run my application
> from the same machine where SQL Server instance is installed, it works
> fine.
> But now I am intending to use it as Client-Server type as database on
> Server
> and application running from another machine. To test this I have
> deployed
> my application on another machine. When I run it I get following error,
> "An
> error has occured while establishing a connection to the server. When
> connecting to SQL Server 2005, this failure may be caused by the fact that
> under the default setting SQL Server does not allow remote
> connections.(provider: SQL Network Interface, error: 26 - Error Locating
> Server/Instance specified)(Microsoft SQL Server Error:-1).
> To Fix this I did try enabling all protocols(Shared Memory, TCP/IP, Named
> Pipe). Then I even started SQL Browser service to enable the instance to
> be
> browsed by client. Then Checked if Hide Instance property. Still no Luck.
> I am really going crazy. This is really important for me since we are
> migrating from Access to SQL Server Express. Since in Access my
> application
> can have client server
> Architecture. Same thing I need to have in SQL Express.
> Any help is really appreciated.
> Thanks,
> Sujata|||Thanks oj...but I found answer...Actually I did everything last time except
creating exceptions in Windows Firewall for instance of my SQL Server to
unblock the connection.
For anyone who is facing similar problem, Follow
http://support.microsoft.com/?id=914277..it is very useful for creating
remote connection.
"oj" wrote:
> use sql2k5 surface area configuration tool to enable 'remote connections'.
> --
> -oj
>
> "Sujata P" <SujataP@.discussions.microsoft.com> wrote in message
> news:94D32EEB-9098-4A51-B55D-95BD84B5AA96@.microsoft.com...
> > Hi,
> > My Application which is written in VB.Net uses database connection to my
> > Local Instance of SQL Server Express version.
> > My connection string is " Data
> > Source=SM5\SQLEXPRESS;AttachDbFilename=C:\Program Files\Microsoft SQL
> > Server\MSSQL.1\MSSQL\Data\MgmtSystem.mdf;Initial
> > Catalog=MgmtSystem;Persist
> > Security Info=True;User ID=sa;Password=belmont". When I run my application
> > from the same machine where SQL Server instance is installed, it works
> > fine.
> > But now I am intending to use it as Client-Server type as database on
> > Server
> > and application running from another machine. To test this I have
> > deployed
> > my application on another machine. When I run it I get following error,
> > "An
> > error has occured while establishing a connection to the server. When
> > connecting to SQL Server 2005, this failure may be caused by the fact that
> > under the default setting SQL Server does not allow remote
> > connections.(provider: SQL Network Interface, error: 26 - Error Locating
> > Server/Instance specified)(Microsoft SQL Server Error:-1).
> >
> > To Fix this I did try enabling all protocols(Shared Memory, TCP/IP, Named
> > Pipe). Then I even started SQL Browser service to enable the instance to
> > be
> > browsed by client. Then Checked if Hide Instance property. Still no Luck.
> > I am really going crazy. This is really important for me since we are
> > migrating from Access to SQL Server Express. Since in Access my
> > application
> > can have client server
> > Architecture. Same thing I need to have in SQL Express.
> >
> > Any help is really appreciated.
> >
> > Thanks,
> > Sujata
>
>

remote database connection

Hello,

My database stays in a remote site and I have access it through VPN. I would like connect my current Windows based Asp.Net application with this database. What are my options? Can I connect remote database with SqlDataAdaper, will that be slow? Should I sue Web Services to connect database?

If you can Ping the database server from the server running the ASP.NET code, you should be able to connect the exact same way as you can connect to a machine right next to your machine. The speed or slowness depends upon exactly what you are doing. It is likely that using the standard SqlClient classes will be faster and easier than trying to do it using a Web Service.

Remote database access

Hi can anybody know how to connect remote database with asp.net application? Actually my database is in different machine (in different server, different location) so i want to connect that server. Every time I'm getting the fallowing message

An error has occured while establishing a connection to the server. 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.

Thank you,

Nagu

Hi,

Please check the article athttp://www.kodyaz.com/content/SQLServerdoesnotallowremoteconnections.aspx about this default security configuration and altering this setting

You can use the Surface Area Configuration tool in order to let remote connections.

Eralper

|||

Hi nagsline ,

First of all enable mixed mode authentication for accessing the database. If you are using an sql username and password make sure that user have access to your database.

|||Also make sure your connection string is correct ie. you have mentioned the correct system name or Ip address etc.|||I don't know if this helps but I thought I would point out that you receive this exact error also when your SQL server is stopped and you try connecting to it.

Remote database

How can I connect to a remote database, based on Microsoft sql server? Is there any article that can help? I have read few over the net, but not working for me yet

Try this link

http://plutonium.cs.umanitoba.ca/ntlabs/MSSQLserver/MSSQLserver-home.html

|||

Prashant Kumar:

Try this link

http://plutonium.cs.umanitoba.ca/ntlabs/MSSQLserver/MSSQLserver-home.html

What I really wanted here is connecting to remote server (via IP address). I'm running windows xp. Which should be something that has to be configured in my connection string

|||

Refer to the following

http://connectionstrings.com/?carrier=sqlserver2005

search for "Connect via an IP address"

Saturday, February 25, 2012

Remote Connections Refused when server under load

Hi All,
We have a .NET 2.0 web application. Occasionally, we get the following
error below when we are doing performance testing. It is not consistent and
only happens every once in awhile. We are using TCP/IP and only have one
instance of SQL running. We do specify connection pooling in the connection
string. There is virtually nothing happening on the database server - it
only contains a few rows of data to control navigation for the site.
System.Data.SqlClient.SqlException: An error has occurred while establishing
a connection to the server. 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
This is a different error and not quite what you describe but it might be
involved in your problem. This is from the Books Online topic "Server
Network Configuration."
Connections May Be Forcibly Closed When Running on Windows Server 2003 SP1
When testing scalability with a large number of client connection attempts
to an instance of the SQL Server Database Engine running on Windows Server
2003 Service Pack 1, Windows may drop connections if the requests arrive
faster than SQL Server can service them. This is a security feature of
Windows Server 2003 Service Pack 1, which implements a finite queue for
incoming TCP connection requests. It results in the following error:
ProviderNum: 7, Error: 10054, ErrorMessage: "TCP Provider: An existing
connection was forcibly closed by the remote host ...
To resolve this issue, use the regedit.exe utility to add the following
registry key:
Key Type Name Value
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\Tcpip\Parameters\
DWORD
SynAttackProtect
00000000
Security Note:
Setting this registry key may expose the server to a SYN flood,
denial-of-service attack. Add this registry value only if necessary and with
an understanding of the security risks. Remove this registry value when
testing is complete.
Rick Byham (MSFT)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Bill P" <Bill P@.discussions.microsoft.com> wrote in message
news:2D3D349D-EE1C-4945-82FE-D3717AD02E2F@.microsoft.com...
> Hi All,
> We have a .NET 2.0 web application. Occasionally, we get the following
> error below when we are doing performance testing. It is not consistent
> and
> only happens every once in awhile. We are using TCP/IP and only have one
> instance of SQL running. We do specify connection pooling in the
> connection
> string. There is virtually nothing happening on the database server - it
> only contains a few rows of data to control navigation for the site.
> System.Data.SqlClient.SqlException: An error has occurred while
> establishing
> a connection to the server. 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
|||Rick,
Thank you for the reply. It very well could have something to do with this.
I am going to give it a try. It may be a few days before I find anything
out since this happens only once in a while.
Bill Portman
"Rick Byham, (MSFT)" wrote:

> This is a different error and not quite what you describe but it might be
> involved in your problem. This is from the Books Online topic "Server
> Network Configuration."
> Connections May Be Forcibly Closed When Running on Windows Server 2003 SP1
> When testing scalability with a large number of client connection attempts
> to an instance of the SQL Server Database Engine running on Windows Server
> 2003 Service Pack 1, Windows may drop connections if the requests arrive
> faster than SQL Server can service them. This is a security feature of
> Windows Server 2003 Service Pack 1, which implements a finite queue for
> incoming TCP connection requests. It results in the following error:
> ProviderNum: 7, Error: 10054, ErrorMessage: "TCP Provider: An existing
> connection was forcibly closed by the remote host ...
> To resolve this issue, use the regedit.exe utility to add the following
> registry key:
> Key Type Name Value
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\Tcpip\Parameters\
> DWORD
> SynAttackProtect
> 00000000
> Security Note:
> Setting this registry key may expose the server to a SYN flood,
> denial-of-service attack. Add this registry value only if necessary and with
> an understanding of the security risks. Remove this registry value when
> testing is complete.
> --
> Rick Byham (MSFT)
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Bill P" <Bill P@.discussions.microsoft.com> wrote in message
> news:2D3D349D-EE1C-4945-82FE-D3717AD02E2F@.microsoft.com...
>

Remote Connections Refused when server under load

Hi All,
We have a .NET 2.0 web application. Occasionally, we get the following
error below when we are doing performance testing. It is not consistent and
only happens every once in awhile. We are using TCP/IP and only have one
instance of SQL running. We do specify connection pooling in the connection
string. There is virtually nothing happening on the database server - it
only contains a few rows of data to control navigation for the site.
System.Data.SqlClient.SqlException: An error has occurred while establishing
a connection to the server. When connecting to SQL Server 2005, this failur
e
may be caused by the fact that under the default settings SQL Server does no
t
allow remote connections. (provider: Named Pipes Provider, error: 40 - Could
not open a connection to SQL ServerThis is a different error and not quite what you describe but it might be
involved in your problem. This is from the Books Online topic "Server
Network Configuration."
Connections May Be Forcibly Closed When Running on Windows Server 2003 SP1
When testing scalability with a large number of client connection attempts
to an instance of the SQL Server Database Engine running on Windows Server
2003 Service Pack 1, Windows may drop connections if the requests arrive
faster than SQL Server can service them. This is a security feature of
Windows Server 2003 Service Pack 1, which implements a finite queue for
incoming TCP connection requests. It results in the following error:
ProviderNum: 7, Error: 10054, ErrorMessage: "TCP Provider: An existing
connection was forcibly closed by the remote host ...
To resolve this issue, use the regedit.exe utility to add the following
registry key:
Key Type Name Value
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControl
Set\Services\Tcpip\Parameters\
DWORD
SynAttackProtect
00000000
Security Note:
Setting this registry key may expose the server to a SYN flood,
denial-of-service attack. Add this registry value only if necessary and with
an understanding of the security risks. Remove this registry value when
testing is complete.
Rick Byham (MSFT)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Bill P" <Bill P@.discussions.microsoft.com> wrote in message
news:2D3D349D-EE1C-4945-82FE-D3717AD02E2F@.microsoft.com...
> Hi All,
> We have a .NET 2.0 web application. Occasionally, we get the following
> error below when we are doing performance testing. It is not consistent
> and
> only happens every once in awhile. We are using TCP/IP and only have one
> instance of SQL running. We do specify connection pooling in the
> connection
> string. There is virtually nothing happening on the database server - it
> only contains a few rows of data to control navigation for the site.
> System.Data.SqlClient.SqlException: An error has occurred while
> establishing
> a connection to the server. 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|||Rick,
Thank you for the reply. It very well could have something to do with this.
I am going to give it a try. It may be a few days before I find anything
out since this happens only once in a while.
Bill Portman
"Rick Byham, (MSFT)" wrote:

> This is a different error and not quite what you describe but it might be
> involved in your problem. This is from the Books Online topic "Server
> Network Configuration."
> Connections May Be Forcibly Closed When Running on Windows Server 2003 SP1
> When testing scalability with a large number of client connection attempts
> to an instance of the SQL Server Database Engine running on Windows Server
> 2003 Service Pack 1, Windows may drop connections if the requests arrive
> faster than SQL Server can service them. This is a security feature of
> Windows Server 2003 Service Pack 1, which implements a finite queue for
> incoming TCP connection requests. It results in the following error:
> ProviderNum: 7, Error: 10054, ErrorMessage: "TCP Provider: An existing
> connection was forcibly closed by the remote host ...
> To resolve this issue, use the regedit.exe utility to add the following
> registry key:
> Key Type Name Value
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControl
Set\Services\Tcpip\Parameters\
> DWORD
> SynAttackProtect
> 00000000
> Security Note:
> Setting this registry key may expose the server to a SYN flood,
> denial-of-service attack. Add this registry value only if necessary and wi
th
> an understanding of the security risks. Remove this registry value when
> testing is complete.
> --
> Rick Byham (MSFT)
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> "Bill P" <Bill P@.discussions.microsoft.com> wrote in message
> news:2D3D349D-EE1C-4945-82FE-D3717AD02E2F@.microsoft.com...
>

Monday, February 20, 2012

remote connection problem

Hi

I'm having a problem connecting to a remote sql server 2000, A, database using asp.net 2.
Im able to connect to another remote database, B, fine but when i connect A i get the following error:

An error has occurred while establishing a connection to the server. 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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

I figure it might be a server problem. I tried using all sorts of connection strings.

Thanks

Hi,

Did you manage to solve this problem? I have the same problem and I am also finding it hard to find anyone to help me.

Thanks

|||

I'm also having this issue, Server is 2003 IIS 6.0. .NET 2.0 I am writing an application hosted on this server that connects to another 2003 server running sqlserver 2005 standard. There is no Firewall enabled on the db server. Remote connections are enabled on the dbserver and allowed through 1433. I've added local service to the security permissions too as well as the username and password that i'm using in the connection string.

I've gone through various posts regarding this error but to no avail. here's the full error as seen in my browser and the connection string i'm using in web.config

An error has occurred while establishing a connection to the server. 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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

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: An error has occurred while establishing a connection to the server. 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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

web.config

<connectionStrings>
<add name="ConnectionString" connectionString="data source=dbserver;Network=DBMSSOCN;initial catalog=ius_hr;Trusted_Connection=yes;user id=username;password=password;packet size=4096"/>
</connectionStrings>

Remote connection failed

I had made an application which is using SQL Expresss.

When I deploy that application on a server where only .Net Framework 2.0 is installed then it gives an error of remote connection.

Does that need some prerequisite for SqlExpress or the reason of error is something else.

Dear Rajkumar,

By default Sql Express does not allow remote connections.

Configuring remote connections is shown overhere.

HTH,

Suprotim Agarwal

|||

The Given points are written on the article you provided.

?Enable remote connections on the instance of SQL Server that you want to connect to from a remote computer.?Turn on the SQL Server Browser service.?Configure the firewall to allow network traffic that is related to SQL Server and to the SQL Server Browser service.

But I don''t have any SQLExpress Server or SQLServer2005 installed on my server machine.

I have only .net framework 2005 installed.

|||

Dear rajkumar,

I agree that your application is deployed on the server where only .NET framework is installed. However my question is where is the database installed.

Well if the db is installed in your machine apply the suggestions given in the post to enable remote connections on your database.

HTH,

Suprotim Agarwal