Click here to Skip to main content
15,916,188 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidOperationException: The 'SQLNCLI11' provider is not registered on the local machine.
at System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper)
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at HMS__Project_.DataSet44TableAdapters.Login_TblTableAdapter.Fill(Login_TblDataTable dataTable)
at HMS__Project_.Patient.Patient_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Posted
Updated 5-Jan-15 7:01am
v2
Comments
ZurdoDev 5-Jan-15 13:16pm    
You need the dll it is referring to. What is your question?
DamithSL 5-Jan-15 13:16pm    
what is your sql server version?
what is your connection string?( remove the username, password and update the question with that)
what have you tried so far?
Muhammad Qasim Ludin 5-Jan-15 13:46pm    
sql server 2008 r2
Muhammad Qasim Ludin 5-Jan-15 13:51pm    
myconnection = new SqlConnection();
myconnection.ConnectionString = "Data Source=global-pc;Initial Catalog=Hospital_Project;User ID=sa;Password=hms;";
myconnection.Open();

1 solution

You have no SQL Native Client installed on your machine or you have 32 bit version but you need 64 bit version...
According to the error you need SQL Native Client 11 which is part of SQL 2012 or 2014...
You can install it from the SQL disk or from here: http://www.microsoft.com/en-us/download/details.aspx?id=29065[^]
 
Share this answer
 
Comments
Muhammad Qasim Ludin 5-Jan-15 13:48pm    
but the link is for to download the instruction file
Kornfeld Eliyahu Peter 5-Jan-15 14:01pm    
So? Follow the instructions...
Muhammad Qasim Ludin 5-Jan-15 14:05pm    
there is nothing to help me
Kornfeld Eliyahu Peter 5-Jan-15 14:09pm    
Oh my dear friend...
1. Open the page in the link
2. Open 'Install Instructions'
3. Search for (Ctrl+F) 'Native'
4. Download and install the proper version (32 or 64 bit)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900