Click here to Skip to main content
15,902,939 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to retreive the Driver Name Pin
iggydarsa10-Apr-08 6:34
iggydarsa10-Apr-08 6:34 
AnswerRe: How to retreive the Driver Name Pin
Giorgi Dalakishvili10-Apr-08 6:31
mentorGiorgi Dalakishvili10-Apr-08 6:31 
AnswerRe: How to retreive the Driver Name Pin
Dave Kreskowiak10-Apr-08 7:13
mveDave Kreskowiak10-Apr-08 7:13 
GeneralGrid View 2.0 Pin
AvinChandrasen10-Apr-08 5:00
AvinChandrasen10-Apr-08 5:00 
GeneralRe: Grid View 2.0 Pin
Dave Kreskowiak10-Apr-08 7:11
mveDave Kreskowiak10-Apr-08 7:11 
GeneralCreateWindow trap in C# Pin
d35tiny10-Apr-08 3:40
d35tiny10-Apr-08 3:40 
GeneralRe: CreateWindow trap in C# Pin
Giorgi Dalakishvili10-Apr-08 6:27
mentorGiorgi Dalakishvili10-Apr-08 6:27 
GeneralInserting Data from other Database File Pin
kallileo10-Apr-08 3:31
kallileo10-Apr-08 3:31 
I use code to insert data from a mdb file into another using the Merge() method of a DataSet...But it's not very effective in terms of performance. Is it possible to use a sql query to directly insert the data? I don't know how to create the code to link the databases.

public void MergeTables(string connS1, string connS2)<br />
        {<br />
            string connString1 = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + connS1;<br />
            string connString2 = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + connS2;<br />
            OleDbConnection oleConn1 = new OleDbConnection(connString1);<br />
            OleDbConnection oleConn2 = new OleDbConnection(connString2);<br />
            string cmd1 = "SELECT *FROM db1_table1";<br />
            string cmd2 = "SELECT *FROM db2_table1";<br />
            OleDbDataAdapter da1 = new OleDbDataAdapter(cmd1, oleConn1);<br />
            OleDbDataAdapter da2 = new OleDbDataAdapter(cmd2, oleConn2);<br />
            DataSet ds1 = new DataSet();<br />
            da1.Fill(ds1, "db1_table1");<br />
            da2.Fill(ds1, "db2_table1");<br />
<br />
            ds1.Tables["db1_table1"].Merge(ds1.Tables["db2_table1"]);<br />
<br />
            foreach (DataRow row in ds1.Tables["db1_table1"].Rows)<br />
                row.SetAdded();<br />
<br />
            OleDbCommandBuilder cmdBld = new OleDbCommandBuilder(da1);<br />
            da1.UpdateCommand = cmdBld.GetUpdateCommand();<br />
            @da1.Update(ds1, "db1_table1");<br />
        }


Thank you Big Grin | :-D
GeneralIs it polite... Pin
Brady Kelly10-Apr-08 3:31
Brady Kelly10-Apr-08 3:31 
GeneralRe: Is it polite... Pin
Pete O'Hanlon10-Apr-08 4:52
mvePete O'Hanlon10-Apr-08 4:52 
GeneralRe: Is it polite... Pin
led mike10-Apr-08 4:55
led mike10-Apr-08 4:55 
GeneralRe: Is it polite... Pin
Brady Kelly10-Apr-08 5:29
Brady Kelly10-Apr-08 5:29 
GeneralRe: Is it polite... Pin
PIEBALDconsult10-Apr-08 5:14
mvePIEBALDconsult10-Apr-08 5:14 
JokeRe: Is it polite... Pin
darkelv10-Apr-08 5:15
darkelv10-Apr-08 5:15 
Generaladding icon to project [modified] Pin
Denver Thomas10-Apr-08 3:22
Denver Thomas10-Apr-08 3:22 
GeneralFile Scan for virus using C# !!!!! Pin
Nithin Krishna10-Apr-08 3:21
Nithin Krishna10-Apr-08 3:21 
GeneralRe: File Scan for virus using C# !!!!! Pin
Judah Gabriel Himango10-Apr-08 4:04
sponsorJudah Gabriel Himango10-Apr-08 4:04 
GeneralInheritance Pin
Brady Kelly10-Apr-08 3:16
Brady Kelly10-Apr-08 3:16 
GeneralRe: Inheritance Pin
Judah Gabriel Himango10-Apr-08 3:59
sponsorJudah Gabriel Himango10-Apr-08 3:59 
GeneralRe: Inheritance Pin
carbon_golem10-Apr-08 5:19
carbon_golem10-Apr-08 5:19 
JokeRe: Inheritance Pin
Luc Pattyn10-Apr-08 6:30
sitebuilderLuc Pattyn10-Apr-08 6:30 
GeneralRe: Inheritance Pin
PIEBALDconsult10-Apr-08 5:17
mvePIEBALDconsult10-Apr-08 5:17 
QuestionHow to add a Worksheet to a Workbook in Excel Pin
Walaza10-Apr-08 2:34
Walaza10-Apr-08 2:34 
QuestionAccessing Form Components from another class(namespace) Pin
Programm3r10-Apr-08 2:11
Programm3r10-Apr-08 2:11 
GeneralRe: Accessing Form Components from another class(namespace) Pin
Pete O'Hanlon10-Apr-08 2:50
mvePete O'Hanlon10-Apr-08 2:50 

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.