How To Configure Connections
Oct 27, 2015
I've been working on a WinForm application (C#) that connects to a database on an external server. My connection string has always been the following and has always worked:
string strCon = "Data Source=static_ip_address;Initial Catalog=someDatabase;User Id=admin;Password=*****";
The specified credentials are actually the physical server's only and local windows account - admin. Contrary to the fact that specifying a user id and password in the connection string uses SQL Authentication, this is practically Windows Authentication as I haven't configured any roles, logins or users in the database or SQL server instance.
Recently there was a power outage and the server was offline. After going back online, my application can no longer communicate with the server. I even modified the connection string to the following and ran the application on the server itself and it still
won't work:
string strCon = "Data Source=localhost;Initial Catalog=someDatabase;Integrated Security = True";
There's obviously something wrong with the server that prevents it from accepting any incoming SQL connections; even those originating from it. I am able to ping the server and even remotely access it from a different network but no SQL connections are being established.
View 8 Replies
ADVERTISEMENT
Nov 3, 2007
I already asked this question at the MSDN forums, but I'm asking it here because I got conflicting answers.
I want to configure my server to allow remote connections. For some unknown reason, I'm unable to do this with the Surface Configuration Tool. My understanding is that I can accomplish this using the sp_configure stored procedure. Is this correct? If so, can someone please give me an example of the correct syntax? BTW, I'm running SQL Server 2005 on winxp pro sp2.
Thanks in advance.
View 2 Replies
View Related
Nov 14, 2006
Hi there! I've been trying for several days now to configure SQL Server 2005 to allow remote connections, apparently, with no luck.
I always have this error message: Microsoft SQL Native Client: 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.
I've followed the instructions at this link -> http://support.microsoft.com/?kbid=914277&SD=tech, but I have been having the same problems.
I've already adjusted my firewall settings.
What should I do?
Please help me...
View 2 Replies
View Related
Jan 17, 2007
Hello there,
I just deployed a new ASP.NET 2.0 website on a remote server http://www.alrazem.com/. and when i want to log on, or when any connection to the database happens!! the following error ocurs.
Server Error in '/' Application.
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)Anyways, I searched the new. and i found this link: http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277... I followed the instructions and changed the Surface Area Configuration for Services and Connections to Local and remote connections. and Applied both protocols. Then redeployed the application. but the error still ocurs.
I didn't restart my machine after changing the SQL to remote. but i did the website from scratch again. and created a new connectionstring and database!!!
Any help? Thanks!
View 1 Replies
View Related
Aug 15, 2006
Hello. I have SQLEXPRESS 2005 installed on my laptop running Windows XP Home Edition with SP2. I have an application that can connect to the local instance with no problem. The other day, I tried to configure SQLEXPRESS 2005 for a remote connection from my desktop. To date, I have been unable to figure out how to do this.
I have followed the instructions posted at various locations on the internet, but to no avail. While I can configure SQLEXPRESS 2005 to allow TCP/IP connections, I have been unable to restart the server.
Here is the pertinent snippet from the error log:
<time> Server A self-generated certificate was successfully loaded for encryption.
<time> Server Error: 26024, Severity: 16, State: 1.
2006-08-14 21:02:27.18 Server Server failed to listen on 'any' <ipv4> 0. Error: 0x277a. To proceed, notify your system administrator.
<time> Server Error: 17182, Severity: 16, State: 1.
<time> Server TDSSNIClient initialization failed with error 0x277a, status code 0xa.
<time> Server Error: 17182, Severity: 16, State: 1.
<time> Server TDSSNIClient initialization failed with error 0x277a, status code 0x1.
<time> Server Error: 17826, Severity: 18, State: 3.
<time> Server Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
<time> Server Error: 17120, Severity: 16, State: 1.
<time> Server SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.
I have a feeling this problem is due to the way my system is configured, not necessarily how my SQLEXPRESS 2005 is configured. My laptop and desktop are connected via a wireless router, and both machines are running Norton Anti-Virus 2006. I've added sqlserver.exe and sqlbrowser.exe to the exceptions list for the Worm protection on the laptop, i.e., the server machine. There's not a setting at the router that would prevent the server from re-starting, is there?
Any help is GREATLY appreciated!
Matt
View 15 Replies
View Related
Nov 13, 2007
Hi
As you know SQL Express by deefault accepts only local connections
For a particular requirement i have to change SQL Server Surface Area Configuration to accept remote connections by dos command
Anyone know this command?
thanks
Marco
View 16 Replies
View Related
Jun 8, 2006
Hi All,
Another requirement has cropped up with regard to picking up connection settings for data sources from an external File.
My source and target are both in SQL Server. What i need is that if my source or target changes I should just change my external file and same should reflect in my package.
How can I accomplish it? Please suggest some solution.
Thanks in advance.
Regards,
Aman Anand
View 2 Replies
View Related
Apr 19, 2008
hi,
could anyone guide me on how to allow, ceate rule for sql server 2005 remote connections to work. i already configured my sql server to allow remote connections and also my router, it is only in isa that is blocking the connections.
thanks
View 1 Replies
View Related
May 17, 2005
Hi there,
Here we have got a
asp.net application that was developed when database was
sitting on SQL server 6.5. Now client has moved all of their databases
to SQL server 2000. When the database was on 6.5 the previous
development team has used oledb connections all over. As the databases
have been moved to SQL server 2000 now i am in process of changing the
database connection part. As part of the process i have a login
authorization code.
Private Function Authenticate(ByVal username As String, ByVal password As String, ByRef results As NorisSetupLib.AuthorizationResult) As Boolean
Dim conn As IDbConnection = GetConnection()
Try
Dim cmd As IDbCommand = conn.CreateCommand()
Dim sql As String = "EDSConfirmUpdate" '"EDSConfirmUpdate""PswdConfirmation"
'Dim cmd As SqlCommand = New SqlCommand("sql", conn)
cmd.CommandText = sql
cmd.CommandType = CommandType.StoredProcedure
NorisHelpers.DBHelpers.AddParam(cmd, "@logon", username)
NorisHelpers.DBHelpers.AddParam(cmd, "@password", password)
conn.Open()
'Get string for return values
Dim ReturnValue As String = cmd.ExecuteScalar.ToString
'Split string into array
Dim Values() As String = ReturnValue.Split(";~".ToCharArray)
'If the return code is CONTINUE, all is well. Otherwise, collect the
'reason why the result failed and let the user know
If Values(0) = "CONTINUE" Then
Return True
Else
results.Result = Values(0)
'Make sure there is a message being returned
If Values.Length > 1 Then
results.Message = Values(2)
End If
Return False
End If
Catch ex As Exception
Throw ex
Finally
If (Not conn Is Nothing AndAlso conn.State = ConnectionState.Open) Then
conn.Close()
End If
End Try
End Function
''' -----------------------------------------------------------------------------
''' <summary>
''' Getting the Connection from the config file
''' </summary>
''' <returns>A connection object</returns>
''' <remarks>
''' This is the same for all of the data classes.
''' Reads a specific
connection string from the web.config file for the service, creates a
connection object and returns it as an IDbConnection.
''' </remarks>
''' -----------------------------------------------------------------------------
Private Function GetConnection() As IDbConnection
'Dim conn As IDbConnection = New System.Data.OleDb.OleDbConnection
Dim conn As IDbConnection = New System.Data.SqlClient.SqlConnection
conn.ConnectionString = NorisHelpers.DBHelpers.GetConnectionString(NorisHelpers.DBHelpers.COMMON)
Return conn
End Function
in the above GetConnection() method i
have commented out the .net dataprovider for oledb and changed it to
.net dataprovider for SQLconnection. this function works fine. But in
the authenticate method above at the line
Dim ReturnValue As String = cmd.ExecuteScalar.ToString
for some reason its throwing the below error.
Run-time exception thrown : System.Data.SqlClient.SqlException - @password is not a parameter for procedure EDSConfirmUpdate.
If i comment out the
Dim conn As IDbConnection = New System.Data.SqlClient.SqlConnection
and uncomment the .net oledb provider,
Dim conn As IDbConnection = New System.Data.OleDb.OleDbConnection
then it works fine.
I also have changed the webconfig file as below.
<!--<add
key="Common" value='User ID=**secret**;pwd=**secret**;Data
Source="ESMALLDB2K";Initial Catalog=cj_common;Auto
Translate=True;Persist Security Info=False;Provider="SQLOLEDB.1";'
/>-->
<add key="Common" value='User ID=**secret**;pwd=**secret**;Data Source="ESMALLDB2K";Initial Catalog=cj_common;' />
Please help. Thanks in advance.
View 4 Replies
View Related
Jul 20, 2005
Just a quick question about connection management. My application willnever need more than 1 or 2 connections about at any given time. Also, I donot expect many users to be connected at any given time. For efficiency, Iwould like to keep connections alive throughout the lifetime of the objectsrequiring them, rather than opening a new connection, executing code andthen closing it again. What is the most efficient way of doing this?Should I perform the open/close or just one open when I create the objectand a close when I dispose of it?
View 1 Replies
View Related
Oct 29, 2007
Guys , I have a dedicated server ... I've installed SQL SERVER 2005 and I have a problem to connect to SQL from local machines in the office ... Remote connections are on , server BRowser starts automatically ... for example from remote machinne I mean from Server where SQL is installed I can connect to SQL ... FireWall i've turned off.... What can be the problem ????
View 3 Replies
View Related
Nov 23, 2006
Hi, I got a website and everything works fine with SQL Server 2000, but now I modified the way of authentication using Forms and when I enter in a protected area I got this error:
An error has occurred while establishing a connection to the server.When connecting to SQL Server 2005, this failure may be caused by thefact that under the default settings SQL Server does not allow remoteconnections. (provider: Named Pipes Provider, error: 40 - Could notopen a connection to SQL Server)
The problem is that I don´t have SQL Server 2005 installed so I don´t know why my webapp is trying to contact it, where I can configure this settings so it will look for the Server that exists?
Thanks.
View 2 Replies
View Related
Mar 13, 2008
In my DAL, I have 3 tables -
Footballer (FootballerID = Primary Key)
Aspnet Membership Table (UserID=Primary Key)
Favourite Footballers (Junction Table with 2 Primary Keys FootballerID and UserID - both with foreign relationships to their respective data table)
On my sports site, visitors can view various footballers and store their favourites in th FavouriteFootballers Table by clicking on a button.
This stores the Logged in UserID and FootballerID in the junction table.
I now need to write a select query that allows users to click a link and view their favourites which they stored - lets say in a data list on another aspx page.
This would include other columns from the Footballer Table such as Name, Age, Profile ect
I think I am right in that I need to use a Select clause as I am using SQl data adapters in the DAL.
Be very pleased if someone knows how to contruct the query and give me an example how to code a method in the BLL
Some code is below
Method that Stores FootballerID and UserIDprotected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
// Assuming only have one button in the item templateInt32 fid = Int32.Parse(e.CommandArgument.ToString());Guid userid = (Guid)Membership.GetUser().ProviderUserKey;
// Connect to the db and insert the recordusing (SqlConnection con = new SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MyDatabase.mdf;Integrated Security=True;User Instance=True"))
{
string query = string.Format("INSERT INTO FavouriteFootballer(UserID, ArtistID) VALUES('{0}',{1})", userid, fid);
SqlCommand cmd = new SqlCommand(query, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
Code in FavouriteFootballersBLL
Its not complete -withotu parameter - i think maybe I also need to reference the Footballer Table and not the Junction one
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]public DataSet1.FavouriteFootballerDataTable GetFootballerFavourites()
{
return Adapter.GetFootballerFavourites();
}
View 2 Replies
View Related
May 14, 2008
Hi,
I am really having a hard time creating a parameter for the RadioButtonList radSearchField. I want to type 's' in the text the choose the column for the query to execute the Select statement. I was able to create a parameter for the txtSearchText but can't get the radSearchField working.
My form contains four objects.
Textbox to perform the query. (name: txtSearchText)
View 5 Replies
View Related
Apr 8, 2005
Is there a way to automate backup? Like it has a schedule. Is this in standard edition.?
Please help a newbie.
View 5 Replies
View Related
May 17, 2006
I have configured SQL XML Support in IIS but still i am not able to Use
http://localhost/ss?Sql=select+*+from+users+for+xml+auto
I am getting Internal Server Error
View 1 Replies
View Related
Mar 19, 2001
Hello All,
We've A2k db which we plan to migrate to SQL 7.0 very soon. Though am familiar with upsizing wizard BUT don't know how to configure Access forms, reports etc. to talk to SQL back end tables. So that information entered via Access forms can be stored in sql and reports can be generated using sql tables..
Thanks in advance..
View 1 Replies
View Related
May 18, 2001
Hi,
I want to send a email after completion of DTS package.
How can I configure SQL Mail??
bye
K.R.Kanth
View 1 Replies
View Related
Sep 2, 2000
hi
Can anyone help me in configuring Sql mail in SQL server 7.0
View 2 Replies
View Related
Jul 30, 2003
Hi,
I'm using Exchange server for our mail communication. If wanted to config SQL Mail in SQL Server 2000 is Ok
1. Insall outlook in sql server
2. US Exchange mail server name in sql mail or any procedure I need to do?
Thanks,
Ravi
View 3 Replies
View Related
Oct 27, 1998
What are the steps in configuring sql server 6.5 to have excellent performance?
what are the items that I should think of and based on what condition I can set up the configuration?
Ahmed
View 1 Replies
View Related
Mar 17, 2004
Hello,
I run a small homw office. I am planning to purchase a dell powerdge 1750 server to install SQL server on that.
I am confused here about which RAID should I install on this server RAID 1 or RAID 5.
The dell customer rep could not tell me the advantages of installing only RAID 1 or only RAID 5 or installing both RAID 1 and RAID 5
View 7 Replies
View Related
Jan 28, 2008
Forum,
I cannot create a Distribution Server on SQL Server 2005 SP1. When I right click on Replication and click "Configure Distribution" and hour glass appears for a minute, and then nothing happens.
I get the same result if I try to create a publication.
Any suggestions on what to do?
Thank you!
View 4 Replies
View Related
Jul 20, 2005
Hi All,Here is my questionWhat might you configure on a SQL Server so that a Web server runningon the same machine, with limited memory, will continue to performoptimally?Thank youRaju
View 1 Replies
View Related
Feb 22, 2007
I have installed SP2 on my SQL 2005 instance which also houses RS of course. Additionally I installed WSS3.0 without configuring it so it has the Object Model installed (should be enough?)
I am running WSS 3.0 on a seperate Server and have the Add-in installed on there.
Following the installation instructions I am going to Application Management to configure WSS, but there is no section called "Reporting Services". Looking on the Report Server, in the Configuration I see the following error under the SharePoint Integration Setting:
The report server cannot access settings in the SharePoint configuration database. Most likely, the Windows SharePoint Services object model is not installed or the Report Server Web Service and Windows service accounts do not have access to SharePoint databases. To configure service account access, use SharePoint Central Administration.
In my SharePoint Site I do see a SharePoint section under the "Site Settings" for managing shared schedules but I think the main issue is, that I don't see that section in Central Administration.
Any help is greatly appreciated.
View 3 Replies
View Related
Mar 25, 2007
Hi every1,
I have problem about configuration in Merge Replication.
First, I configure for SQL Server 2000, expand Replication> Publication>New Publication>Choose Publication Database, I choose pubs>Select Publication Type, choose Merge Replication>Specify Subscribers Type, choose Servers running SQL Server 2000 and Devices running SQL Server CE>Specify article (ex. authors)€¦>Finish. I configure succeeded (A snapshot of 1 article(s) is generated).
Snapshot folder reference to path: \server_nameC$Program FilesMicrosoft SQL Server 2005 Mobile EditionServerReplication
Next, I configure for SQL Server Mobile Agent, Subscriber Type, choose SQL Server Mobile Edition>Web server, choose Create a new virtual directory>Alias: Replication (reference to the path: C:Program FilesMicrosoft SQL Server 2005 Mobile EditionServerReplication)..>Client Authentication, choose Client will connect anonymously€¦.>Snapshot share access, enter \server_nameReplication =>error: The share '\server_nameReplication' cannot be accessed. Please specify a new share. Why that?
I want to ask u I configure that correctly? If Subscriber is Pocket PC Emulator, what is subscriber €™s property of SqlCeReplication (Windows PocketPC Emulator?)?
Plz help me. Thanks so much.
View 3 Replies
View Related
Mar 16, 2007
We have an 8gb SQL server running Windows Server 2003 Enterprise Edition that simply will not get above 3gb of memory usage. We are using SQL 2000 Enterprise edition, version 2040 - SP4. My boot.ini has been configured with /3gb /PAE. System Properties does list Physical Address Extension as being enabled. AWE is enabled, and has been verified in the SQL server logs. Lock pages in memory access has been given to the account SQL is started under. Under task manager, the process sqlservr.exe does not grow above 2,762,428 ish. Does anyone know why this is occuring?
View 4 Replies
View Related
Nov 8, 2006
hi,
First, sorry for my english, I'm french
When i try to configure web synchronization, I get the following err " success Hresult 0x8007000"(!!!) for the step : setting the snapshot share permission
I really don't understand : my folder have all the rights for the user agent...
I don't know what to do.
Config . SQL Server SP4,Microsoft SQL Server 2005 Mobile Edition
It had worked but I had to reinstall the system and now, it does not work anymore
Thans for your help,
Eric
View 18 Replies
View Related
Nov 8, 2007
.. the Membership ProviderUserKey value as the parameter of a stored procedure ?It seems obvious to me that you would want to do this, but I can only see that it allows you to pass Profile parameters.
View 2 Replies
View Related
May 15, 2006
When configuring the SqlDataSource, what source do I need to specify
for getting the ID passing through the URL? I tried Form but it's not
getting the ID through the URL. Help is appreciated.
View 2 Replies
View Related
May 14, 2002
I had a SQL server 7.0 with 1 gb of RAM.
I just added more memory and now I have 4 gb of RAM. How can I canfigure SQL to take advantage of this.
View 2 Replies
View Related
Jun 7, 2000
Hi all,
I'm having a problem configuring one of my SQL servers
as a distributor. I've done it successfully on another
server, so I know that it's nothing procedural and there
must be an issue with the way the server is set up.
When I click 'finish' on the Configure Publication and
Distribution Wizard, I get the following error message:
Enterprise Manager could not configure 'ABEL' as the
distributor for 'ABEL'.
Error 20017: Cannot add the remote distributor at this time.
Make sure that the local server is configured as a Distribution
Publisher at the Distributor.
Can anyone point me in the right direction? I'm fairly new
to SQL Server, so feel free to explain things in a
condescending manner. ;-)
View 1 Replies
View Related
Mar 19, 2003
I have a SQL Server version 7.0 and want to configure IBM DB2 on OS 390 as a linked server on it . I installed DB2 clients on the SQL Server and thru DB2 Connect ,I am able to access the mainframe data using the clients . However I am having problems configuting the Mainframe server using IBM DB2 OLE DB Driver .I am not sure if we need to use Microsoft OLE DB Driver .
View 3 Replies
View Related