Showing posts with label engine. Show all posts
Showing posts with label engine. Show all posts

Tuesday, March 27, 2012

Connecting To SQL Server

Hi,

I have a problem in logging in to an SQL Server database engine. I can log in to the engine with Windows authentication method. The problem is, when I create a page with an SqlDataConnection control, the page can not connect to the database engine eventhough I select "Use Windows Authentication" when configuring the SqlDataConnection. What should I do?

Best regards,

Haris

This article explains how to connect to SQL Server using Windows authentication.

http://msdn2.microsoft.com/en-us/library/ms998292.aspx

|||

Is the steps in the article that you mentioned also applicable on SQL Server 2005?

|||

Hi haris101,

Yes. It is applicable on sql2005.

The problem is, when I create a page with an SqlDataConnection control, the page can not connect to the database engine eventhough I select "Use Windows Authentication" when configuring the SqlDataConnection

what is your error message when your connection fails? also, did you get the error from visual web developper or IIS?

If you are getting the error from IIS (which i thin is the most case), make sure you have granted ASPNET (if using win xp) or NETWORK SERVICE (if using win 2003 server) the proper access permission. As to how to grant permission to a specific account, you can check the link tsm gave you . thanks

Sunday, March 25, 2012

connecting to SQL DATABASE ENGINE

hello everybody!!!

I am very new to SQL SERVER 2005 EXPRESS EDITION

while connecting to DATABASE ENGINE i got this error message.....

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) (.Net SqlClient Data Provider)

any solution please?

Hi,

If you are trying on a local machine.

login properly :

server instance: computer_name\SQLSERVER_INSTANCE_NAME

user name : computer_name\user_name

If trying on a remote machine:

have a look in the following link:

http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

Hope it'll help.

|||

this error is very common... You check whether the instance is configured for Remote connection

Start --Microsoft sql server 2005-- Configuration Tools -- SQL Server Surface Area Configuration -- Surface Area configuration for services and connections -- Select Remote Connection -- Select Local and remote connection Radio button and using both TCP/IP and named pipes

ALso check whether the firewall is enabled. if yes create exception for 1433 and 1434

Madhu

sqlsql

Sunday, March 11, 2012

Connecting to DB Engine

I am running a mirrored database using SQL2005 and whether or not mirroring has anything to do with this has not been determined. Often when a failover is necessary we are in a state where the active server responds just enough to show existence but not enough to determine database state. The SQL Management Studio can not connect to the server and the exception report from our application has the following message:

<exception type="System.Data.SqlClient.SqlException">

<message>A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)</message>
<source>.Net SqlClient Data Provider</source>
<target>System.Data.ProviderBase.DbConnectionPool::GetConnection</target>
<stack>

<trace index="0">at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)</trace>
<trace index="1">at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)</trace>
<trace index="2">at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)</trace>
<trace index="3">at System.Data.SqlClient.SqlConnection.Open()</trace>
<... application stack/>
</stack>

</exception>

When this happens, the the SqlClient does not fail over to the mirror until we stop the service on the failed SQL server. Sometimes, the mirror server doesn't full pick up until we stop the service on the failed server.

Today, out of curiosity I attemped to connect to port 1433 using TelNet to see if the server was even listening at the standard endpoint anymore (before I received the Exception Report above). It was. So how do I determine what is happening that causes the connections to close, and if at all possible - prevent it?

Thanks in advance for any advice you may have.

-Dave

Server Version:

Microsoft SQL Server 2005 - 9.00.3042.00 (X64)

Feb 10 2007 00:59:02

Copyright (c) 1988-2005 Microsoft Corporation

Standard Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)

HI Dave,

Check for the following,

1.) Check the login whether it has necessary privileges on the database(default db for the login) its going to connect. Since the error shows its connected to the server and not to the default db.

2.) Check on which port Sqlserver is listening then connect using the port as servername,portno.

If possible post Errorlog & Eventlog info....
|||

Vidhya,

Yes. The login does have the rights and it is connecting to the correct port. When this occurs we (the DB admins) can not even connect via SQL Management Studio. We have to shut the service down via the Service Control Manager in Windows.

-Dave

Connecting to DB Engine

I am running a mirrored database using SQL2005 and whether or not mirroring has anything to do with this has not been determined. Often when a failover is necessary we are in a state where the active server responds just enough to show existence but not enough to determine database state. The SQL Management Studio can not connect to the server and the exception report from our application has the following message:

<exception type="System.Data.SqlClient.SqlException">

<message>A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)</message>
<source>.Net SqlClient Data Provider</source>
<target>System.Data.ProviderBase.DbConnectionPool::GetConnection</target>
<stack>

<trace index="0">at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)</trace>
<trace index="1">at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)</trace>
<trace index="2">at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)</trace>
<trace index="3">at System.Data.SqlClient.SqlConnection.Open()</trace>
<... application stack/>
</stack>

</exception>

When this happens, the the SqlClient does not fail over to the mirror until we stop the service on the failed SQL server. Sometimes, the mirror server doesn't full pick up until we stop the service on the failed server.

Today, out of curiosity I attemped to connect to port 1433 using TelNet to see if the server was even listening at the standard endpoint anymore (before I received the Exception Report above). It was. So how do I determine what is happening that causes the connections to close, and if at all possible - prevent it?

Thanks in advance for any advice you may have.

-Dave

Server Version:

Microsoft SQL Server 2005 - 9.00.3042.00 (X64)

Feb 10 2007 00:59:02

Copyright (c) 1988-2005 Microsoft Corporation

Standard Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)

HI Dave,

Check for the following,

1.) Check the login whether it has necessary privileges on the database(default db for the login) its going to connect. Since the error shows its connected to the server and not to the default db.

2.) Check on which port Sqlserver is listening then connect using the port as servername,portno.

If possible post Errorlog & Eventlog info....
|||

Vidhya,

Yes. The login does have the rights and it is connecting to the correct port. When this occurs we (the DB admins) can not even connect via SQL Management Studio. We have to shut the service down via the Service Control Manager in Windows.

-Dave

Sunday, February 19, 2012

Connecting Database Engine (SQl server 2005 file .*mdf) from Win CE 5.0 platform

Is this possible to connect do the Database Engine (on sql server 2005 on XP platorm - file *.mdf (not mobile *.sdf)) from win CE 5.0?

I tried to do this :

ConnectionStringSQLServerCE = "Data Source=WORK_STATION\\SQLEXPRESS;Initial Catalog=dbMachines;Integrated Security=False;Password=Panel;User ID=Panel";

SqlCeConnectionCE = new SqlConnection(ConnectionStringSQLServerCE);

SqlCeConnectionCE.Open();

but I catch error:

catch (PlatformNotSupportedException ex)

?PlatformNotSupportedException”

I noticed that I see server because when I use:

ConnectionStringSQLServerCE = "Data Source=WORK_STATION\\SQLEXPRESS";

zwraca b??d typu

catch (SqlException ex)

“Login failed for user ''. The user is not associated with a trusted SQL Server connection.”

I used

using System.Data.SqlClient;

from Compact Framework 2.0 under Visual Studio 2005 Device Application Windows CE 5.0

can anyone help me?

Yes, it is possible to connect to SQL Server 2000/2005, SQL Express and MSDE from NETCF application using SQL Client.

PlatformNotSupportedException usually happens if particular device does not support locale database it in. For example, if your database uses Polish collation, you'd need device localized in Polish in order to use it. Alternatively you could change database collation to one available on device.

As to connection issue, your server need to be properly configured and you should have functional network connectivity. Please see this for general troubleshooting:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=335660&SiteID=1

Sunday, February 12, 2012

connect to sql server desktop engine over internet

i have got to connect to sql server desktop engine over internet with the following connection string

conString = "Provider=SQLOLEDB.1;Persist Security Info=True;Initial Catalog=" & dbName & ";Network Address=" & IPAddress & ";Data Source=" & DataSource & " ;User ID=" & UserId & " ; Password=" & Password

Plz also inform me about the restriction imposed in connectivity by any of the window operating system such as that win 98 wont work or work!

There is no firewall involved. The two computers are in the same room and connected directly to the internet.

Even the ping is not going to either computer.

So what could be the possible problem and the solution.

need urgentsetup a domain or at least a workgroup so you can access the resources on the msde machine from the other computer. untill you can at least ping it you won't be able to connect.