title: The 'SQLNCLI' provider is not registered on the local machine
body: <p>I have a NAnt-based script which that I run on my local PC that connects to SQL Server 2008 Express also running on my local PC to drop and recreate databases using .sql files - this works fine, no problem here.</p>
  
  <p>The problem comes when I have recreated the same set-up on another PC, I get the error in my NAnt script saying that:</p>
  
  <pre class="lang-none prettyprint-override"><code>System.InvalidOperationException: The 'SQLNCLI' provider is not registered on the local machine.
    at System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper&amp; datasrcWrapper)
    at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
    at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
    at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
    at System.Data.OleDb.OleDbConnection.Open()
    at NAnt.Contrib.Util.SqlHelper..ctor(String connectionString, Boolean useTransaction)
    at NAnt.Contrib.Tasks.SqlTask.ExecuteTask()
    at NAnt.Core.Task.Execute()
    at NAnt.Core.Target.Execute()
    at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
    at NAnt.Core.Project.Execute()
    at NAnt.Core.Project.Run()
  </code></pre>
  
  <p>I have searched online and have found that in a forum it was suggested that I needed to install the Microsoft SQL Server Native Client, and <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C6C3E9EF-BA29-4A43-8D69-A2BED18FE73C&amp;displaylang=en" rel="noreferrer">got it from this URL</a>.  (Admittedly, I have only installed the Native Client part of this)</p>
  
  <p>Despite this being installed on my second PC, the script still gives me the same error. Any suggestions?</p>