Click here to Skip to main content
15,910,886 members
Home / Discussions / Database
   

Database

 
GeneralRe: ODBC Performance Pin
N a v a n e e t h6-Nov-07 2:31
N a v a n e e t h6-Nov-07 2:31 
GeneralRe: ODBC Performance Pin
Colin Angus Mackay6-Nov-07 2:35
Colin Angus Mackay6-Nov-07 2:35 
GeneralRe: ODBC Performance Pin
N a v a n e e t h6-Nov-07 2:38
N a v a n e e t h6-Nov-07 2:38 
GeneralRe: ODBC Performance Pin
Colin Angus Mackay6-Nov-07 2:45
Colin Angus Mackay6-Nov-07 2:45 
GeneralRe: ODBC Performance Pin
N a v a n e e t h6-Nov-07 2:47
N a v a n e e t h6-Nov-07 2:47 
GeneralOptionally use BCP in stored proc Pin
Brady Kelly6-Nov-07 1:41
Brady Kelly6-Nov-07 1:41 
GeneralRe: Optionally use BCP in stored proc Pin
Brady Kelly6-Nov-07 2:30
Brady Kelly6-Nov-07 2:30 
QuestionCopy data between databases [modified] Pin
Nick De Decker5-Nov-07 23:02
Nick De Decker5-Nov-07 23:02 
Hi,

I've spent hours trying to copy data from a table in database A to a similar table in database B.
My code doesn't return any errors but I simply don't get any rows in my db.

Can someone tell me how to do this ?

I'm using mysql as database.


Dim CnERP As MySql.Data.MySqlClient.MySqlConnection = Febelfin.Administratie.Propertys.DatabaseConnectie<br />
Dim CnSite As New MySql.Data.MySqlClient.MySqlConnection<br />
CnSite.ConnectionString = "Database=databaseB;Data Source=host;User Id=nick; Password=test"<br />
'databaseconnectie was predefined ...<br />
<br />
<br />
Dim Cmd As New MySql.Data.MySqlClient.MySqlCommand<br />
Cmd.CommandText = "SELECT * FROM opleiding WHERE opl_publiceren=1"<br />
Cmd.Connection = CnERP<br />
<br />
        Dim DTerp, DTsite As New DataTable<br />
<br />
        Dim AdaptErp As New MySql.Data.MySqlClient.MySqlDataAdapter(Cmd)<br />
        AdaptErp.Fill(DTerp)<br />
<br />
        Cmd.Connection = CnSite<br />
<br />
<br />
        Dim Cmd2 As New MySql.Data.MySqlClient.MySqlCommand<br />
        Cmd2.CommandText = "SELECT * FROM opleiding_nick"<br />
        Cmd2.Connection = CnSite<br />
<br />
        Dim adaptSite As New MySql.Data.MySqlClient.MySqlDataAdapter(Cmd2)<br />
        adaptSite.Fill(DTsite)<br />
<br />
        Dim CBsite As New MySql.Data.MySqlClient.MySqlCommandBuilder(adaptSite)<br />
<br />
        For Each dr As DataRow In DTerp.Rows<br />
            DTsite.ImportRow(dr)<br />
            dr.SetAdded()<br />
            dr.AcceptChanges()<br />
        Next<br />
<br />
        DTsite.AcceptChanges()<br />
        CnSite.Open()<br />
        adaptSite.Update(DTsite)<br />
        CnSite.Close()<br />
<br />
        DTsite.AcceptChanges()<br />
<br />


.... so i've tried a lot, but nothing seems to work.
I'm probably forgetting something.

How come it does not insert the rows in the destination db ?

thanks !


-- modified at 5:22 Tuesday 6th November, 2007
AnswerRe: Copy data between databases Pin
belloSoft7-Nov-07 10:55
belloSoft7-Nov-07 10:55 
QuestionGUID in Access 2000 Pin
Christian Graus4-Nov-07 23:44
protectorChristian Graus4-Nov-07 23:44 
GeneralDatabase Testing Concurrency [modified] Pin
Brady Kelly4-Nov-07 22:47
Brady Kelly4-Nov-07 22:47 
GeneralRe: Database Testing Concurrency Pin
Pete O'Hanlon4-Nov-07 22:51
mvePete O'Hanlon4-Nov-07 22:51 
GeneralOT Pin
Mustafa Ismail Mustafa4-Nov-07 23:17
Mustafa Ismail Mustafa4-Nov-07 23:17 
GeneralRe: OT Pin
Pete O'Hanlon4-Nov-07 23:24
mvePete O'Hanlon4-Nov-07 23:24 
GeneralRe: OT Pin
Brady Kelly5-Nov-07 0:06
Brady Kelly5-Nov-07 0:06 
GeneralRe: Database Testing Concurrency Pin
SimulationofSai4-Nov-07 22:57
SimulationofSai4-Nov-07 22:57 
GeneralRe: Database Testing Concurrency Pin
Pete O'Hanlon4-Nov-07 23:02
mvePete O'Hanlon4-Nov-07 23:02 
GeneralRe: Database Testing Concurrency Pin
Brady Kelly4-Nov-07 23:16
Brady Kelly4-Nov-07 23:16 
GeneralRe: Database Testing Concurrency Pin
Pete O'Hanlon4-Nov-07 23:25
mvePete O'Hanlon4-Nov-07 23:25 
GeneralRe: Database Testing Concurrency Pin
Brady Kelly4-Nov-07 23:36
Brady Kelly4-Nov-07 23:36 
GeneralRe: Database Testing Concurrency Pin
Pete O'Hanlon4-Nov-07 23:44
mvePete O'Hanlon4-Nov-07 23:44 
GeneralRe: Database Testing Concurrency Pin
Brady Kelly4-Nov-07 23:58
Brady Kelly4-Nov-07 23:58 
GeneralRe: Database Testing Concurrency Pin
Pete O'Hanlon5-Nov-07 0:01
mvePete O'Hanlon5-Nov-07 0:01 
GeneralRe: Database Testing Concurrency Pin
Brady Kelly5-Nov-07 0:04
Brady Kelly5-Nov-07 0:04 
GeneralRe: Database Testing Concurrency Pin
SimulationofSai5-Nov-07 0:08
SimulationofSai5-Nov-07 0:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.