My c# form has an error in the connection from c# with oracle 11g express edition, I've put my connection string in app.config file. This is my connection string:
add name="ConnectionString" connectionString="Provider=MSDAORA;Data Source=localhost;Password=LIB314;User ID=LIB_DB" providerName="System.Data.OleDb"
When I want to run a query, it gives me error saying
The 'MSDAORA' provider is not registered on the local machine
I use Windows 8.1 Pro x64... Can anyone please help me?
UseORAOLEDB.ORACLE rather than MSDAORA.
Check below URL
https://community.oracle.com/thread/1022162
Thanks
Nipun
Try using OraOLEDB instead of MSDAORA. Register OraOLEDB11.dll using regsvr32.exe.
To do so, open command prompt and browse to the BIN folder of under your Oracle HOME's installation path (probably oracle\product\11.2.0\dbhome1\BIN) and execute the following line:
>regsvr32.exe OraOLEDB11.dll
Also, ensure verify that the PATH variable is set properly and points to Oracle's installation path i.e.: C:\oracle\product\11.2.0\dbhome1\BIN
Related
I have a WPF application connecting to a local SQL Server database file (.mdf). I am using Entity Framework.
Connection string is:
Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\db_SmartPOS.mdf;Integrated Security=True
The directory is changed to the following:
string doc = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
AppDomain.CurrentDomain.SetData("DataDirectory", doc + #"\SmartPOS\");
I have copied the .mdf files manually to that specified directory, tested it, and everything is working well on my main machine, where SQL Server 2014 is installed.
Now I am deploying the app to another PC, where I installed SQLLocalDB. However, whenever I try to connect to the database, I get this exception:
System.Data.EntityException. The underlying provider failed to open --> Sysmte.Data.SqlClient.SqlException.....The specified local db instance does not exist.
The .mdf and log files are placed in the directory specified above. I have also tried to copy them to the directory where the application is installed.
I am wondering what am I missing?
So here how it worked.
First of all I found an article online that specified that the connection string in SQL 2014 is different than the one in SQL 2012, therefore Data Source=(LocalDB)\MSSQLLocalDB used in 2014 should be switched to Data Source=(LocalDB)\v11.0. If using Entity framework, this should be done the connection strings settings and in app.config.
Once this was done, i tested it on the other system, and the exception error changed. This time the application was able to connect, however there was something wrong with the versions and i was unable to access it.
I downloaded SQL server 2014 localdb engine and replaced the 2012, and everything worked fine!
Hopefully this will help someone
I have a C# application which accesses a local auto-named database like DB_Users.mdf to pull out user connection details.
My connection string is:
Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\DB_Users.mdf;Integrated Security=True
When I deploy this application on a laptop, I get an error like this
The database"C:\ProgramFiles(x86)\ISTL\PCArchieSetup|DB_USEr.MDF" can't be opened because itis version 852 ,the Server support version 782 and earlier.Couldn't open new database "C:\programfiles\IstL\PcArchie\DB_users.mdf"Create database is aborted.An attempt to attach an auto-named database for file "C:\programfiles\IstL\PcArchie\DB_users.mdf" failed. A database with the same name exist or specific file cannot be opened on UNC share
Initially, I thought this VS version problem. So I updated to VS community 2015. But still getting the same error. I suspect the file location it's trying to access is the problem. But don't know how to resolve it. Can you share your thoughts on this? Thanks in advance for your help.
I want to write to a .accdb file. When I test and do such from localhost it works w/o any issues. However if I try to write to it from my URL it errors. The .accdb is stored in a folder created from within VS called Database.
How should I set up/store the .accdb so I can write to it from the web?
Error message is
The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.
Connetion String is
"Microsoft.Jet.OleDb.4.0;Data Source=|DataDirectory|Testing.accdb"
EDIT
if I change the connection string to 12.0 same error message
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
In Resposne To Comment
I am using VS2010 and do not have the option of in my options
In the bottom-left corner of the Options dialog, check the box that says, "Show all settings"
This is what I see under optionsenter image description here
What is your server operating system version?You may need to install Access software on your server.
And if your Access is x86,you need to specify the x86 mode to compile your project,instead of using anycpu mode.
You'd better use Microsoft.ACE.OLEDB.12.0,when your database is .accdb.
If not OK, you can try to download and install Microsoft Access Database Engine 2010 Redistributable: url(http://www.microsoft.com/en-us/download/details.aspx?id=13255) .
I am trying to build my first .exe from a c# winforms project. I am using the Flexera Installing Shield. So far I can build and install it and it runs successfully on the same machine where I am developing. In this project I am using a local db. I can also install it on another machine, but as soon as I`m trying to access the Db via a button it complains. I think it has something to do with the connection string. At least it complains at the line where I am trying to access the Db with:
Error 26 - Error Locating Server/Instance Specified
Here is my obviously wrong connection string:
string connectionString = #"Data Source=(LocalDB)\v11.0;AttachDbFilename=""C:\Users\idiot\Documents\Visual Studio 2013\Projects\Vis\Vis\LocalDbVisTest.mdf"";Integrated Security=True";
Thank you for any help or hint in advance!
Instead of using an absolute path for your connection string, use
Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\LocalDbVisTest.mdf;Integrated Security=True
The reason your program cannot find the database is because it is looking in
C:\Users\idiot\Documents\Visual Studio 2013\Projects\Vis\Vis\LocalDbVisTest.mdf
Which, presumably, doesn't exist on your client's machine.
You can manually set your DataDirectory by using AppDomain.CurrentDomain.SetData("DataDirectory", path). You can get the path of your executable by using AppDomain.CurrentDomain.BaseDirectory
I have a windows Application written at C Sharp, which is updating data store in SQL server 2008. When I am running application from .Net, I have no issues. I compiled application and install on the same laptop. When I run exe file I am getting the following error: "System.Data.SqlException (0x80131904): A network-related or instance-specific error occured while-establishing a connection to SQL Server. The server was not found or was not accessible".
Why I can connect to SQL server from MS Visual Studio, and not able to make connection to SQL from executable file (same laptop) ? Thank you.
Make sure the config file where your SQL connection string should be stored is next to the exe file when you install your application.
Please ensure that you have a file called "projectname.exe.config" right next to your exe. If so, then please ensure that you have the SQL connection string in this config file. If so, the please ensure that it is the correct connection string. Also, please ensure that the user account specified in the connection string has access to the DB. If you are using windows authentication (SSPI) then please ensure the your windows account has access to the DB.
NOTE: the config file name MUST be "exeName.exe.config". The exeName is usually the project name. Just in case you have changed the exe name from the default.
Hope this helps.