Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Thursday, March 22, 2012

error: 40 - Could not open a connection

I am developing a web service that uses a sql data connection.

The sql database is on a server, and the development version of my web service is on my pc.

I can connect/access the data accross my network when I run the service on my PC, but as soon as I put the web service onto the server(with the sql) it displays, the service wont function - error: 40 - could not open a connection....

I presume that sql is configured correctly as I am recieving data back when I request it accross the network. I dont understand why it wont work when I have the service on the server with the sql?

Any help will be appreciated.

Do you mean your web service and SQL server are on the same machine? Can you post your connection string here? On which account your web service is running?|||

Yes they are both on the same server

"Data Source=SV1;Initial Catalog=SiteVisitSQL;Integrated security=sspi"

My web service is running on IUSR_SV1, I have created an account for the database/user in Microsoft SQL Server Management Studio Express

Ive never configured anything like this before so any help is much appreciated.

|||

Thanks for all your help

I solved this by adding a user for NT AUTHORITY\NETWORK SERVICE in SQL Management studio

Friday, March 9, 2012

Error with web synchronization

Hello,

We have SQL2k5 SP1 as our database server. We have another box running IIS for web synchronization. We are seeing a lot of errors on the client side stating that they are unable to connect to the distributor. When we look at the event log on the IIS box we find application errors with the replisapi.dll. Below is a dump from the event log of the IIS box. Both boxes are 2003 with the currect patches and each have 4 GB RAM. Any help would be appreciated.

John

Event Type:Error

Event Source:Application Error

Event Category:(100)

Event ID:1000

Date:9/12/2006

Time:8:12:48 PM

User:N/A

Computer: SERVER-IIS5

Description:

Faulting application w3wp.exe, version 6.0.3790.1830, faulting module replisapi.dll, version 2005.90.1399.0, fault address 0x0002bd67.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Data:

0000: 41 70 70 6c 69 63 61 74Applicat

0008: 69 6f 6e 20 46 61 69 6cion Fail

0010: 75 72 65 20 20 77 33 77urew3w

0018: 70 2e 65 78 65 20 36 2ep.exe 6.

0020: 30 2e 33 37 39 30 2e 310.3790.1

0028: 38 33 30 20 69 6e 20 72830 in r

0030: 65 70 6c 69 73 61 70 69eplisapi

0038: 2e 64 6c 6c 20 32 30 30.dll 200

0040: 35 2e 39 30 2e 31 33 395.90.139

0048: 39 2e 30 20 61 74 20 6f9.0 at o

0050: 66 66 73 65 74 20 30 30ffset 00

0058: 30 32 62 64 36 3702bd67

Hi John

1) What results do you get running the diagnostics mode?

"https://{secuseServerAddress}/{virtualFolder}/replisapi.dll?diag"

2) How did you set up Web Synchronization on the IIS box i.e. Through "Configure Web Synchronization Wizard" or by manually creating folders, copying and registering replisapi.dll etc..? (Incorrectly registered dll and web extensions not being installed will also cause issues)

3) Was IIS already installed prior to installing the SQL Server 2005 Components onto this box? (SQL Server setup may not have been able to set up the extensions correctly)

4) Is the Database Server box running the same version of SQL Server 2005 i.e. Service Packs included. (I have experienced problems with this in the past)

Just a few pointers from my experience so far. I'm not too knowledgable about IIS and it's more detailed inner workings there may be others better placed to suggest action?

Rab|||

Rab,

1.

SQL Websync diagnostic information

Client Information:

AUTH_USER:domain\user
AUTH_TYPE:Basic
HTTPS:on
LOGON_USER:domain\user
REMOTE_ADDR:24.30.144.122
REMOTE_HOST:24.30.144.122
REMOTE_USER:domain\user
REQUEST_METHOD:GET
SERVER_NAME:replicate.url.com
SERVER_PORT:443
SERVER_PROTOCOL:HTTP/1.1
SERVER_SOFTWARE:Microsoft-IIS/6.0
URL:/replia/replisapi.dll

Class Initialization test:

ClassStatusErrorCode
replisapi.dll classesSUCCESS0x0
CLSID_SQLReplErrorsSUCCESS0x0
replrec.dll classesSUCCESS0x0
msxml6.dll classesSUCCESS0x0

ReplIsapi Statistics:

CounterValue
Active worker threads.8
Active Requests.1
Total Query Requests1
Total File Download Requests0
Total Sync Requests373
Total Requests Handled1120
Max queue wait time (ms)0
Average time in Queue (ms)0
Max sync duration (ms)148078
Average Sync Duration (ms)6615

ReplIsapi Settings:

PropertyValue
SNAC version (sqlncli.dll)2005.90.1399.0
Logging EnabledFALSE

2) How did you set up Web Synchronization on the IIS box i.e. Through "Configure Web Synchronization Wizard" or by manually creating folders, copying and registering replisapi.dll etc..? (Incorrectly registered dll and web extensions not being installed will also cause issues)

We created the files manually as SQL isn't really installed on this box other than what the documents told us to do
3) Was IIS already installed prior to installing the SQL Server 2005 Components onto this box? (SQL Server setup may not have been able to set up the extensions correctly)

IIS was already installed on the box
4) Is the Database Server box running the same version of SQL Server 2005 i.e. Service Packs included. (I have experienced problems with this in the past)

When we upgraded the server to SP1 we took the new replisapi.dll and replaced the old one on the IIS box.

|||

Firstly you should be using the install process to install the tools only installation on the IIS box.

Next, you should not be just copying the replisapi.dll and replacing it on the IIS box. The IIS SQL components should be upgraded to SP1 too.

If you are already doing this and still hitting the error, I would recommend contacting CSS and opening a case with them.

Error with web synchronization

Hello,

We have SQL2k5 SP1 as our database server. We have another box running IIS for web synchronization. We are seeing a lot of errors on the client side stating that they are unable to connect to the distributor. When we look at the event log on the IIS box we find application errors with the replisapi.dll. Below is a dump from the event log of the IIS box. Both boxes are 2003 with the currect patches and each have 4 GB RAM. Any help would be appreciated.

John

Event Type:Error

Event Source:Application Error

Event Category:(100)

Event ID:1000

Date:9/12/2006

Time:8:12:48 PM

User:N/A

Computer: SERVER-IIS5

Description:

Faulting application w3wp.exe, version 6.0.3790.1830, faulting module replisapi.dll, version 2005.90.1399.0, fault address 0x0002bd67.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Data:

0000: 41 70 70 6c 69 63 61 74Applicat

0008: 69 6f 6e 20 46 61 69 6cion Fail

0010: 75 72 65 20 20 77 33 77urew3w

0018: 70 2e 65 78 65 20 36 2ep.exe 6.

0020: 30 2e 33 37 39 30 2e 310.3790.1

0028: 38 33 30 20 69 6e 20 72830 in r

0030: 65 70 6c 69 73 61 70 69eplisapi

0038: 2e 64 6c 6c 20 32 30 30.dll 200

0040: 35 2e 39 30 2e 31 33 395.90.139

0048: 39 2e 30 20 61 74 20 6f9.0 at o

0050: 66 66 73 65 74 20 30 30ffset 00

0058: 30 32 62 64 36 3702bd67

Hi John

1) What results do you get running the diagnostics mode?

"https://{secuseServerAddress}/{virtualFolder}/replisapi.dll?diag"

2) How did you set up Web Synchronization on the IIS box i.e. Through "Configure Web Synchronization Wizard" or by manually creating folders, copying and registering replisapi.dll etc..? (Incorrectly registered dll and web extensions not being installed will also cause issues)

3) Was IIS already installed prior to installing the SQL Server 2005 Components onto this box? (SQL Server setup may not have been able to set up the extensions correctly)

4) Is the Database Server box running the same version of SQL Server 2005 i.e. Service Packs included. (I have experienced problems with this in the past)

Just a few pointers from my experience so far. I'm not too knowledgable about IIS and it's more detailed inner workings there may be others better placed to suggest action?

Rab
|||

Rab,

1.

SQL Websync diagnostic information

Client Information:

AUTH_USER: domain\user
AUTH_TYPE: Basic
HTTPS: on
LOGON_USER: domain\user
REMOTE_ADDR: 24.30.144.122
REMOTE_HOST: 24.30.144.122
REMOTE_USER: domain\user
REQUEST_METHOD: GET
SERVER_NAME: replicate.url.com
SERVER_PORT: 443
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Microsoft-IIS/6.0
URL: /replia/replisapi.dll

Class Initialization test:

Class Status ErrorCode
replisapi.dll classes SUCCESS 0x0
CLSID_SQLReplErrors SUCCESS 0x0
replrec.dll classes SUCCESS 0x0
msxml6.dll classes SUCCESS 0x0

ReplIsapi Statistics:

Counter Value
Active worker threads. 8
Active Requests. 1
Total Query Requests 1
Total File Download Requests 0
Total Sync Requests 373
Total Requests Handled 1120
Max queue wait time (ms) 0
Average time in Queue (ms) 0
Max sync duration (ms) 148078
Average Sync Duration (ms) 6615

ReplIsapi Settings:

Property Value
SNAC version (sqlncli.dll) 2005.90.1399.0
Logging Enabled FALSE

2) How did you set up Web Synchronization on the IIS box i.e. Through "Configure Web Synchronization Wizard" or by manually creating folders, copying and registering replisapi.dll etc..? (Incorrectly registered dll and web extensions not being installed will also cause issues)

We created the files manually as SQL isn't really installed on this box other than what the documents told us to do
3) Was IIS already installed prior to installing the SQL Server 2005 Components onto this box? (SQL Server setup may not have been able to set up the extensions correctly)

IIS was already installed on the box
4) Is the Database Server box running the same version of SQL Server 2005 i.e. Service Packs included. (I have experienced problems with this in the past)

When we upgraded the server to SP1 we took the new replisapi.dll and replaced the old one on the IIS box.

|||

Firstly you should be using the install process to install the tools only installation on the IIS box.

Next, you should not be just copying the replisapi.dll and replacing it on the IIS box. The IIS SQL components should be upgraded to SP1 too.

If you are already doing this and still hitting the error, I would recommend contacting CSS and opening a case with them.

Error with web synchronization

Hello,

We have SQL2k5 SP1 as our database server. We have another box running IIS for web synchronization. We are seeing a lot of errors on the client side stating that they are unable to connect to the distributor. When we look at the event log on the IIS box we find application errors with the replisapi.dll. Below is a dump from the event log of the IIS box. Both boxes are 2003 with the currect patches and each have 4 GB RAM. Any help would be appreciated.

John

Event Type:Error

Event Source:Application Error

Event Category:(100)

Event ID:1000

Date:9/12/2006

Time:8:12:48 PM

User:N/A

Computer: SERVER-IIS5

Description:

Faulting application w3wp.exe, version 6.0.3790.1830, faulting module replisapi.dll, version 2005.90.1399.0, fault address 0x0002bd67.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Data:

0000: 41 70 70 6c 69 63 61 74Applicat

0008: 69 6f 6e 20 46 61 69 6cion Fail

0010: 75 72 65 20 20 77 33 77urew3w

0018: 70 2e 65 78 65 20 36 2ep.exe 6.

0020: 30 2e 33 37 39 30 2e 310.3790.1

0028: 38 33 30 20 69 6e 20 72830 in r

0030: 65 70 6c 69 73 61 70 69eplisapi

0038: 2e 64 6c 6c 20 32 30 30.dll 200

0040: 35 2e 39 30 2e 31 33 395.90.139

0048: 39 2e 30 20 61 74 20 6f9.0 at o

0050: 66 66 73 65 74 20 30 30ffset 00

0058: 30 32 62 64 36 3702bd67

Hi John

1) What results do you get running the diagnostics mode?

"https://{secuseServerAddress}/{virtualFolder}/replisapi.dll?diag"

2) How did you set up Web Synchronization on the IIS box i.e. Through "Configure Web Synchronization Wizard" or by manually creating folders, copying and registering replisapi.dll etc..? (Incorrectly registered dll and web extensions not being installed will also cause issues)

3) Was IIS already installed prior to installing the SQL Server 2005 Components onto this box? (SQL Server setup may not have been able to set up the extensions correctly)

4) Is the Database Server box running the same version of SQL Server 2005 i.e. Service Packs included. (I have experienced problems with this in the past)

Just a few pointers from my experience so far. I'm not too knowledgable about IIS and it's more detailed inner workings there may be others better placed to suggest action?

Rab|||

Rab,

1.

SQL Websync diagnostic information

Client Information:

AUTH_USER:domain\user
AUTH_TYPE:Basic
HTTPS:on
LOGON_USER:domain\user
REMOTE_ADDR:24.30.144.122
REMOTE_HOST:24.30.144.122
REMOTE_USER:domain\user
REQUEST_METHOD:GET
SERVER_NAME:replicate.url.com
SERVER_PORT:443
SERVER_PROTOCOL:HTTP/1.1
SERVER_SOFTWARE:Microsoft-IIS/6.0
URL:/replia/replisapi.dll

Class Initialization test:

ClassStatusErrorCode
replisapi.dll classesSUCCESS0x0
CLSID_SQLReplErrorsSUCCESS0x0
replrec.dll classesSUCCESS0x0
msxml6.dll classesSUCCESS0x0

ReplIsapi Statistics:

CounterValue
Active worker threads.8
Active Requests.1
Total Query Requests1
Total File Download Requests0
Total Sync Requests373
Total Requests Handled1120
Max queue wait time (ms)0
Average time in Queue (ms)0
Max sync duration (ms)148078
Average Sync Duration (ms)6615

ReplIsapi Settings:

PropertyValue
SNAC version (sqlncli.dll)2005.90.1399.0
Logging EnabledFALSE

2) How did you set up Web Synchronization on the IIS box i.e. Through "Configure Web Synchronization Wizard" or by manually creating folders, copying and registering replisapi.dll etc..? (Incorrectly registered dll and web extensions not being installed will also cause issues)

We created the files manually as SQL isn't really installed on this box other than what the documents told us to do
3) Was IIS already installed prior to installing the SQL Server 2005 Components onto this box? (SQL Server setup may not have been able to set up the extensions correctly)

IIS was already installed on the box
4) Is the Database Server box running the same version of SQL Server 2005 i.e. Service Packs included. (I have experienced problems with this in the past)

When we upgraded the server to SP1 we took the new replisapi.dll and replaced the old one on the IIS box.

|||

Firstly you should be using the install process to install the tools only installation on the IIS box.

Next, you should not be just copying the replisapi.dll and replacing it on the IIS box. The IIS SQL components should be upgraded to SP1 too.

If you are already doing this and still hitting the error, I would recommend contacting CSS and opening a case with them.

Error with web synchronization

Hello,

We have SQL2k5 SP1 as our database server. We have another box running IIS for web synchronization. We are seeing a lot of errors on the client side stating that they are unable to connect to the distributor. When we look at the event log on the IIS box we find application errors with the replisapi.dll. Below is a dump from the event log of the IIS box. Both boxes are 2003 with the currect patches and each have 4 GB RAM. Any help would be appreciated.

John

Event Type:Error

Event Source:Application Error

Event Category:(100)

Event ID:1000

Date:9/12/2006

Time:8:12:48 PM

User:N/A

Computer: SERVER-IIS5

Description:

Faulting application w3wp.exe, version 6.0.3790.1830, faulting module replisapi.dll, version 2005.90.1399.0, fault address 0x0002bd67.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Data:

0000: 41 70 70 6c 69 63 61 74Applicat

0008: 69 6f 6e 20 46 61 69 6cion Fail

0010: 75 72 65 20 20 77 33 77urew3w

0018: 70 2e 65 78 65 20 36 2ep.exe 6.

0020: 30 2e 33 37 39 30 2e 310.3790.1

0028: 38 33 30 20 69 6e 20 72830 in r

0030: 65 70 6c 69 73 61 70 69eplisapi

0038: 2e 64 6c 6c 20 32 30 30.dll 200

0040: 35 2e 39 30 2e 31 33 395.90.139

0048: 39 2e 30 20 61 74 20 6f9.0 at o

0050: 66 66 73 65 74 20 30 30ffset 00

0058: 30 32 62 64 36 3702bd67

Hi John

1) What results do you get running the diagnostics mode?

"https://{secuseServerAddress}/{virtualFolder}/replisapi.dll?diag"

2) How did you set up Web Synchronization on the IIS box i.e. Through "Configure Web Synchronization Wizard" or by manually creating folders, copying and registering replisapi.dll etc..? (Incorrectly registered dll and web extensions not being installed will also cause issues)

3) Was IIS already installed prior to installing the SQL Server 2005 Components onto this box? (SQL Server setup may not have been able to set up the extensions correctly)

4) Is the Database Server box running the same version of SQL Server 2005 i.e. Service Packs included. (I have experienced problems with this in the past)

Just a few pointers from my experience so far. I'm not too knowledgable about IIS and it's more detailed inner workings there may be others better placed to suggest action?

Rab|||

Rab,

1.

SQL Websync diagnostic information

Client Information:

AUTH_USER:domain\user
AUTH_TYPE:Basic
HTTPS:on
LOGON_USER:domain\user
REMOTE_ADDR:24.30.144.122
REMOTE_HOST:24.30.144.122
REMOTE_USER:domain\user
REQUEST_METHOD:GET
SERVER_NAME:replicate.url.com
SERVER_PORT:443
SERVER_PROTOCOL:HTTP/1.1
SERVER_SOFTWARE:Microsoft-IIS/6.0
URL:/replia/replisapi.dll

Class Initialization test:

ClassStatusErrorCode
replisapi.dll classesSUCCESS0x0
CLSID_SQLReplErrorsSUCCESS0x0
replrec.dll classesSUCCESS0x0
msxml6.dll classesSUCCESS0x0

ReplIsapi Statistics:

CounterValue
Active worker threads.8
Active Requests.1
Total Query Requests1
Total File Download Requests0
Total Sync Requests373
Total Requests Handled1120
Max queue wait time (ms)0
Average time in Queue (ms)0
Max sync duration (ms)148078
Average Sync Duration (ms)6615

ReplIsapi Settings:

PropertyValue
SNAC version (sqlncli.dll)2005.90.1399.0
Logging EnabledFALSE

2) How did you set up Web Synchronization on the IIS box i.e. Through "Configure Web Synchronization Wizard" or by manually creating folders, copying and registering replisapi.dll etc..? (Incorrectly registered dll and web extensions not being installed will also cause issues)

We created the files manually as SQL isn't really installed on this box other than what the documents told us to do
3) Was IIS already installed prior to installing the SQL Server 2005 Components onto this box? (SQL Server setup may not have been able to set up the extensions correctly)

IIS was already installed on the box
4) Is the Database Server box running the same version of SQL Server 2005 i.e. Service Packs included. (I have experienced problems with this in the past)

When we upgraded the server to SP1 we took the new replisapi.dll and replaced the old one on the IIS box.

|||

Firstly you should be using the install process to install the tools only installation on the IIS box.

Next, you should not be just copying the replisapi.dll and replacing it on the IIS box. The IIS SQL components should be upgraded to SP1 too.

If you are already doing this and still hitting the error, I would recommend contacting CSS and opening a case with them.

Wednesday, March 7, 2012

error with scale-out web server: Invalid object name

We are adding a second web server to our farm. Reporting Services is installed on one web server as Rpt01 instance and works just fine. We have installed the second web server also with an instance named Rpt01 and are now trying to configure to re-use the same database as the first server. When we restart services we get the error listed below.

I was wondering if there was an issue with the same named instances on two different web servers accessing the same ReportServer01 database? This is the error that we are getting. Any help would be appreciated. The curious thing is that our databases are named ReportServer01 and ReportServer01TempDB and not the name listed below.

ReportingServicesService!schedule!4!1/23/2007-15:40:20:: Unhandled exception caught in Scheduling maintenance thread: System.Data.SqlClient.SqlException: Invalid object name 'ReportServerTempDB.dbo.ExecutionCache'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.ReportingServices.Library.InstrumentedSqlCommand.ExecuteNonQuery()
at Microsoft.ReportingServices.Library.SchedulePollWorker.ClearConsistancyFlag()
at Microsoft.ReportingServices.Library.SchedulePollWorker.CheckScheduleConsistancy(Object state)

Same Named instances should work fine. Check in the RSConfigTool for each instance in the webfarm , they are connected to ReportServer01 database and they are properly initialized. Was the second instance immediately joined in the farm or it operated as a standalone RS Server where some schedules were created?|||

Thanks for the response. The first instance may have had some schedules created but the second one was installed and configured immediately. I have uninstalled the second instance and reinstalled but am getting exact same issue. I used a different instance name this time, Rpt02, just so I could see reference differences.

Also when I uninstalled the second web server instance, it was never removed from the initialized list of the farm. I try to manually remove it using the Config tool and it gives an unknown error has occurred message. After reinstalling the second instance I am able to successfully add it to the initialized list. Still a little worried that an instance that no longer exists still appears in the list...

|||The uninstalled instance appearing in the initialization list should not be any problem. Are the schedules firing correctly now?|||No. Strangest thing... We can't get any subscriptions to work on this installation. We can create subscriptions and I see that the sql agent runs the scheduled job but then nothing else happens. No errors are logged and no mail arrives.|||I am now being told that if you rename your ReportServer database (which I did) and then set configuration to this database that this error could occur. I'm looking for the correct steps for renaming your ReportServer database. If anyone has them could you share? I will probably go back to the old name since it sounds like I am stuck with that name.|||

The problem has been fixed. I found one trigger in the ReportServer01 database that was referencing the old ReportServerTempDB database. I corrected the name and all is good now.

I'm told that we shouldn't change our database name after the ReportServer database has been created so I will follow that for future. Here's the trigger that I had to change.

CREATE TRIGGER [Schedule_UpdateExpiration] ON [dbo].[Schedule]
AFTER UPDATE
AS
UPDATE
EC
SET
AbsoluteExpiration = I.NextRunTime
FROM
[ReportServerTempDB].dbo.ExecutionCache AS EC
INNER JOIN ReportSchedule AS RS ON EC.ReportID = RS.ReportID
INNER JOIN inserted AS I ON RS.ScheduleID = I.ScheduleID AND RS.ReportAction = 3

GO

Sunday, February 26, 2012

error with connection with SQL SERVER

Hi

I am developing web application.

I have connected my app. with sql server using web.config as code given below using Named pipe connection

<appSettings>
<add key="constring" value="Server=ebserver;UID=sa;database=Airport-Clearance;Integrated Security=SSPI;network library=dbnmpntw;" />
</appSettings
After than i have added a new CLASS in my app.
in that, I have written as given below code.

public SqlConnection GetConnection()
{
System.Configuration.AppSettingsReader objApp = new System.Configuration.AppSettingsReader ();
SqlConnection sqlconn = new SqlConnection ();
sqlconn.ConnectionString = Convert.ToString(objApp.GetValue("constring", typeof(string)));
return sqlconn ;
}

Finally, In load event of form, I have written as below code.

Class1 objcs = new Class1() ;
SqlConnection sqlconn = objcs.GetConnection ();
SqlDataAdapter filling = new SqlDataAdapter("select * from Airport",sqlconn);
DataSet ds = new DataSet();
sqlconn.Open();
//filling.Fill(ds,"Airport");

//DataGrid dg = new DataGrid();
dg.DataSource = ds.Tables["Airport"];
dg.DataBind();
//Do what ever
sqlconn.Close ();

When i run this application

It gives error like

provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

If i use try catch then it doesnt display any error.but Even it doesnt display datagrid on form.

Please give me solution.

Even how to run app. line by line as we run in VB using F8.

Reply please,

Regards,
ASIFTry this instead (assuming you're not using beta version):

public SqlConnection GetConnection()
{
SqlConnection sqlconn = new SqlConnection ();
sqlconn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["constring"].ConnectionString;
return sqlconn ;
}

Error with conn string

Just installed AJAX for VS2005 and started to build a AJAX enabled web site. I got the following message after creating a database (SQL) and Dataset "FOLLOWING ERROR OCCURED WHLE GETTING CONNECTION STRING INFORMATION FROM CONFIGURATION:'CANNOT GET WEB APPLICATION SERVICE'.

I didn't have this problem before,can it be related to AJAX?

Thank you in advance,

close your VS 2005 and open it again The SQLConnection error might go away.

Sunday, February 19, 2012

Error while running script on host server

I am trying to deploy my database-driven ASP.NET application to my web server. I have hosting through godaddy.com and they require that you run a script through their SQL admin Query Analyzer to create the database. After I attach the database in the Management Studio, I generate the script, copy and paste it into the QA and get the following error. Any help?

Error -2147217900

Line 18: Incorrect syntax near '('.

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Students]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Students](
[StudentID] [int] IDENTITY(1,1) NOT NULL,
[FirstName] [nvarchar](20) NULL,
[LastName] [nvarchar](20) NULL,
[PhoneNumber1] [nvarchar](15) NULL,
[PhoneNumber2] [nvarchar](15) NULL,
[Instrument] [nchar](20) NULL,
[Interests] [nvarchar](50) NULL,
[Active] [bit] NULL,
[TimeID] [int] NULL,
[UserID] [nchar](20) NULL,
CONSTRAINT [PK_Students] PRIMARY KEY CLUSTERED
(
[StudentID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Lessons]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Lessons](
[LessonID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
[CurrentNotes] [nvarchar](250) NULL,
[FutureNotes] [nvarchar](250) NULL,
[DateTime] [datetime] NULL,
[StudentID] [int] NOT NULL,
CONSTRAINT [PK_Lessons] PRIMARY KEY CLUSTERED
(
[LessonID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
IFNOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id =OBJECT_ID(N'[dbo].[FK_Lessons_Students]') AND parent_object_id =OBJECT_ID(N'[dbo].[Lessons]'))
ALTER TABLE [dbo].[Lessons] WITH CHECK ADD CONSTRAINT [FK_Lessons_Students] FOREIGN KEY([StudentID])
REFERENCES [dbo].[Students] ([StudentID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Lessons] CHECK CONSTRAINT [FK_Lessons_Students]

That's because you the script is generated for a SQL2005 table in Management Studio, so it contains some new elements in SQL2005 which do not exist in SQL2000. Then when you tried to execute it in Query Analyzer (which uses SQL2000 T-SQL rules), QA failed to parse some new T-SQL syntax (I see it is the WITH block following the CONSTRAINT definition here).

For more information about T-SQL enhancement in SQL2005, you can refer to:

http://msdn.microsoft.com/library/en-us/dnsql90/html/sql_05TSQLEnhance.asp?

BTW, system schemas also have been changed in SQL2005, so if you try to refer to 'sys.objects' as in the script in SQL2000, an 'object not exist' error will be raised. For information, please refer to:

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

Error while runnign web appication using Visual studio 2005

Hello,

I have made one application in asp.net using C#. It is running perfect in my visual studio 2005 and also on localhost.

Currently i have installed visual studio 2005 in new PC. Now that application is running fine under Localhost. But it is giving me error when i run

it through visual studio in New PC and the error is

" Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed. "

One more point is that i have used DSN and so i checked the DSN also and it is also correct.

Second thing is I have two directoryadmin anduser.If I run the pages of admin directory then it is running fine. But if i run the page of user directory then it is showing

me the above eror. I have also made different config files for both directory and one general config file for whole directory.

I have also search on google for this problem and they asked me to delete SQLEXPRESS directory from C drive but it is not get deleted and it shows the error that

"it is being used by some other program please try again."

So you might have understood my problem. Please help me to get out of this problem. Thanks a lot for reading my problem.

Regards,

Hardik B.

Well if you're looking to delete that directory, you will probably have to shut down your Mircosoft SQL Server service (control panel -> admin tools -> Services). I'm not sure if that will fix your problem though.. Also, make sure to restart your service after you finish your delete.

Wednesday, February 15, 2012

Error while establishing a connection to the SQL server 2005 - Could not open a connection

Hi,

I had an old web application created during asp.net 1.1 and it have a connection problem with the sql server 2005 when it is mirgrated to a new webserver with dotnet framework 2.0 platform. I have enabled the remote access(TCP/IP and named pipes) in sql server 2005, did all the neccessary things, check whether the TCP/IP is enabled, named pipe is enabled...

I created another web application using VS 2005. The database connection works perfectly well.

This are the connectionString from the old web application.

<appSettings>
<addkey="ConnectionString"value="Server=127.0.0.1;Database=somedb;User id=user; Password=somepassword; Trusted_Connection=False; POOLING=FALSE"/>
</appSettings>

Thankyou in advance!

I am not sure but maybe try this?

<appSettings>
<addk="ConnectionString"value="Server=127.0.0.1;Database=somedb;User id=user; Password=somepassword;"/>
</appSettings>

or

<appSettings>
<addk="ConnectionString"value="workstation id="computername";packet size=4096;data source=yourserver;initial catalog=yourdatabase ;user id=user;password=password"/>
</appSettings>


|||

Thank jpazgier for your help. I have tried and tested it out. However the problem still exist.. =(

|||Could you provide code where you use your connection string? How you read it from config file and how you use it to get data?|||

Hi,

This error message is just a basic connectivity error meaning the client could not connect to the target SQL Server. So just follow the basic connectivity troubleshooting guidelines on our SQL Protocols blog, see:

SQL Server 2005 Connectivity Issue Troubleshoot - Part I
http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx

and

SQL Server 2005 Connectivity Issue Troubleshoot - Part II
http://blogs.msdn.com/sql_protocols/archive/2005/10/29/486861.aspx
This should help you debug the problem.

error while Configuring XML Support in IIS with IIS 6.0

Hi,

I've two servers on which there is the SQL 2000 Server and the IIS 6.0.

I installed the SQL Server Client Tools on web server.

And created the nwind as told in booksonline.

I declared the SQLXML extention and allowed it using IIS 6.

But there is a problem with the virtual directory I created using the tool "Configure XML Support in IIS". Web server doesn't realize it as a virtual directory. Even a jpg or a text file is not served by the IIS.

The web server shows the following error.

ERROR: 500 Internal Server Error
HResult: 0x800706f4
Source: Microsoft SQL isapi extension
Description: Invalid virtual root settings

Thanks for any suggestions.Ok,

Do not use Client Tools any more on web server.

Instead, yuo can use SQLXML 3.0.

This solved my problem.|||Cool. Glad it's solved. The good news is that Yukon integrates all these features, so there won't be this kind of confusion. That is, if you can wait a year or so for Yukon!

Don