Click here to Skip to main content
13,863,292 members
Rate this:
 
Please Sign up or sign in to vote.
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 4: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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
   

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web02 | 2.8.190214.1 | Last Updated 12 Feb 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100