(provider: TCP Provider, error: 0 – No connection could be made because the target machine actively refused it.)

The scenario: You try to connect to Sql Server but you are getting the following connection error (they vary depending on the provider used):   Using the .Net SqlClient provider: ———————————————————————————————————————————————————— System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify…

1

Unable to find the requested .Net Framework Data Provider. It may not be installed.

From .Net 2.0 there is an option for you to obtain your dataprovider (usually if using 3rd party providers) by using the DbProviderFactories/ DbProviderFactory classes.   A simple example:   string provider = “System.Data.SqlClient”; DbProviderFactory dbFactory = DbProviderFactories.GetFactory(provider);   Now, every now and then I get cases where the customer reports the following error when…

3

Create a LINQ/WCF/Silverlight application in 10 simple steps.

Ok, today I will show how to create a super simple application that uses some of the new stuff you find in .Net 3.5. Try this and then you can throw cool words like Windows Communication Foundation (WCF), LINQ to SQL and Silverlight around you.   This is not intended to be a deep dive…

1

What version of a particular dll is my application running? Find out using code.

Sometimes you may wish to find out what versions of particular dlls’ your application is using. If running on your dev machine it is not hard. But what if you have an application that is to be deployed to hundreds of users?   Well, the easiest thing is to have your users to start your…

0

The importance of selecting the correct Sql provider for the job. Sqlncli vs. Sqlncli10

Imagine this; you have been looking at the new data type DateTime2 in Sql Server 2008 because you have a need for the increased precision this data type offers.   Comparison here: “SQL Server 2008 Books Online (October 2008) – datetime2 (Transact-SQL)”   http://msdn.microsoft.com/en-us/library/bb677335.aspx “SQL Server 2008 Books Online (October 2008) – datetime (Transact-SQL)”  …

1

SMO Transfer.TransferData() gives: A network-related or instance-specific error occurred while establishing a connection to SQL Server.

Today’s post will deal with something that I do not usually deal with, and that is SMO (Sql Server Management Objects). The reason is that I helped a colleague the other day, and I was a bit confused to start with in regard to why the aptly named method TransferData on the Transfer class threw…

0

SQL Server Error: 10060 SQL Server Error: 10061

Ok, new entry with connectivity problems and examples.   The scenario: You have a SQL Server 2005 that is up and running you also know that the SQL Browser service is up and running. So on the server side, all is well.   On a side note, if you do not know what the SQL…

5

How to update an Excel worksheet using DataSet and the OleDbDataAdapter

One very convenient thing in ADO.Net is the DataAdapters. These give you an easy way to fill DataTables and DataSets, and also to update the backing data source with very little effort. However, in order to be able to do INSERT/UPDATE/DELETE you have to set the appropriate commands for the Adapter. Ie:   OleDbDataAdapter adapter…

1