Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Team,


How to use two data bases in single data source using C# connection connection.

Example:
INSERT OR IGNORE INTO testDBNew.module(name) 
                      SELECT (Name) FROM TestDB.Module;


Please provide solution for above requirement.

thanks in advance.

What I have tried:

INSERT OR IGNORE INTO testDBNew.module(name)
SELECT (Name) FROM TestDB.Module;

I have tried to use above query to access two databases, but not able to access it.
Posted
Updated 12-Feb-19 3:13am
v2
Comments
Maciej Los 12-Feb-19 4:39am    
What kind of database?
Mohankumar.Engain 12-Feb-19 5:39am    
SQLite data base using for Creating windows application

1 solution

For SQLite, you need to ATTACH the other database before you can access it:
SQLite ATTACH DATABASE with Examples[^]

NB: The attached databases are not persisted. Every time you open a new connection, you will need to attach them again.
 
Share this answer
 

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