Click here to Skip to main content
15,895,142 members
Home / Discussions / Database
   

Database

 
AnswerRe: How to calculate count? Pin
Harini N K30-Apr-08 18:58
Harini N K30-Apr-08 18:58 
QuestionDatabase upload and Append Pin
L²+D30-Apr-08 3:24
L²+D30-Apr-08 3:24 
AnswerRe: Database upload and Append Pin
Rob Graham30-Apr-08 11:42
Rob Graham30-Apr-08 11:42 
GeneralRe: Database upload and Append Pin
L²+D1-May-08 3:21
L²+D1-May-08 3:21 
GeneralRe: Database upload and Append Pin
Youtea1-May-08 16:36
Youtea1-May-08 16:36 
RantRe: Database upload and Append Pin
Youtea2-May-08 5:40
Youtea2-May-08 5:40 
GeneralRe: Database upload and Append Pin
L²+D2-May-08 6:41
L²+D2-May-08 6:41 
GeneralRe: Database upload and Append Pin
Rob Graham2-May-08 3:21
Rob Graham2-May-08 3:21 
First, you need two different connections, one for the input database, the other for the output. If the data in the "upload" copy is just to be appended to the "master" copy (no changes to existing rows in the master), then I would open a data reader on the "upload" table, and use an isert query to insert rows to the master while reading rows from the updload - psuedocode:
ConnMaster.Open(masterconnstring);
ConUpload.Open(uploadConnString);
string sql = "insert into master_table (f1,f2,f3) values (?,?,?)"
OledbCommand cmmd = new OleDbCommand(ConnMaster,sql);
using (Datareader dr = ConnUpload.Executereader("select f1,f2,f3from upload table");)
{
  while (dr.Read())
  {
    try{
    cmd.parameters.clear();
    cmd.parameters.add(new oledbparameter("p1",dr[0].getvalue());
    cmd.parameters.add("p2",dr[1].getvalue());
    cmd.parameters.add("p3",dr[2].getvalue());
    cmd.execute();
    }
    catch(oledbexception e)
    {
      logdata("insert failed" + e.tostring());
     }
  }
}


code not exact, please look up correct syntax .
GeneralRe: Database upload and Append Pin
L²+D2-May-08 5:00
L²+D2-May-08 5:00 
GeneralRe: Database upload and Append Pin
Rob Graham2-May-08 7:31
Rob Graham2-May-08 7:31 
GeneralRe: Database upload and Append Pin
L²+D6-May-08 11:14
L²+D6-May-08 11:14 
GeneralRe: Database upload and Append Pin
Rob Graham12-May-08 12:33
Rob Graham12-May-08 12:33 
QuestionMySql Connector .NET table exists Pin
annodomini230-Apr-08 2:56
annodomini230-Apr-08 2:56 
AnswerRe: MySql Connector .NET table exists Pin
Pete O'Hanlon30-Apr-08 3:27
mvePete O'Hanlon30-Apr-08 3:27 
AnswerRe: MySql Connector .NET table exists Pin
N a v a n e e t h30-Apr-08 3:34
N a v a n e e t h30-Apr-08 3:34 
GeneralRe: MySql Connector .NET table exists Pin
annodomini230-Apr-08 4:54
annodomini230-Apr-08 4:54 
GeneralRe: MySql Connector .NET table exists Pin
Pete O'Hanlon30-Apr-08 11:58
mvePete O'Hanlon30-Apr-08 11:58 
QuestionScripting SQL 2005 Database objects and Data Pin
Banjo Ayorinde29-Apr-08 22:27
Banjo Ayorinde29-Apr-08 22:27 
AnswerRe: Scripting SQL 2005 Database objects and Data Pin
Blue_Boy29-Apr-08 22:58
Blue_Boy29-Apr-08 22:58 
AnswerRe: Scripting SQL 2005 Database objects and Data Pin
Ashfield30-Apr-08 20:22
Ashfield30-Apr-08 20:22 
QuestionHow to get default databases in SQL Server 2005 Pin
VenkataRamana.Gali29-Apr-08 22:23
VenkataRamana.Gali29-Apr-08 22:23 
AnswerRe: How to get default databases in SQL Server 2005 Pin
R. Giskard Reventlov29-Apr-08 23:55
R. Giskard Reventlov29-Apr-08 23:55 
Questiondifference between sql,ms sql and sqlserver 2000 Pin
salil_k_singh29-Apr-08 20:29
salil_k_singh29-Apr-08 20:29 
AnswerRe: difference between sql,ms sql and sqlserver 2000 Pin
Ashfield29-Apr-08 21:17
Ashfield29-Apr-08 21:17 
JokeRe: difference between sql,ms sql and sqlserver 2000 Pin
Youtea30-Apr-08 20:48
Youtea30-Apr-08 20:48 

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.