Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
this is the connection string to get data in the windows application. am getting the data but when i use this application in the another system getting the error

string opera = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Opera Software\opera stable\History";

SQLiteConnection con = new SQLiteConnection("DataSource=" + opera + "; version=3; new =false;compress=true;"
Posted
Updated 22-Dec-14 19:13pm
v2
Comments
Praveen Kumar Upadhyay 23-Dec-14 1:12am    
What error are you getting?
Srikanth59 23-Dec-14 1:18am    
System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.94.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The system cannot find the file specified.
Srikanth59 23-Dec-14 1:36am    
Is There any another way without copy dll's files in the local environment
Praveen Kumar Upadhyay 23-Dec-14 1:44am    
You need to copy the dlls to the production server into the exe folder.
Maciej Los 23-Dec-14 2:14am    
Connection string is wrong. You forgot to add at the end of string the file name ;)
opera = "...\YourDatabase.db";

You need to copy below dll into the exe folder where it is deployed. These dlls you must be having in your local environment.
System.Data.SQLite.Linq.dll
System.Data.SQLite.DLL
 
Share this answer
 
Please, read my comment to the question.

Here is an idea: Connection Strings and Configuration Files[^]
 
Share this answer
 
Hi....
add this below text to app.config in windows application

<configuration>
<connectionstrings>
<add>
name="sqlCon" connectionString="Data Source=Your Sql Server Name;Initial Catalog=Your DataBase Name;User ID=Your SQL user ID;Password=Your SQL Password" />




add below code to cs page
System.Configuration.AppSettingsReader settingsReader = new System.Configuration.AppSettingsReader();
string sConnectionString = (string)settingsReader.GetValue("sqlCon", typeof(string));

now u will get the connectionstring in sConnectionString variable ....

by
anantH.g
 
Share this answer
 
v2

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