Click here to Skip to main content
15,914,221 members
Home / Discussions / Database
   

Database

 
GeneralSQL Join over two databases Pin
ppp00128-Feb-05 15:40
ppp00128-Feb-05 15:40 
GeneralRe: SQL Join over two databases Pin
Timcyspet28-Feb-05 16:27
Timcyspet28-Feb-05 16:27 
GeneralRe: SQL Join over two databases Pin
ABBASI_RA2-Mar-05 5:44
ABBASI_RA2-Mar-05 5:44 
GeneralRe: SQL Join over two databases Pin
ppp0015-Mar-05 19:00
ppp0015-Mar-05 19:00 
GeneralRe: SQL Join over two databases Pin
Mike20154-Mar-05 0:40
Mike20154-Mar-05 0:40 
GeneralRe: SQL Join over two databases Pin
ppp0015-Mar-05 19:00
ppp0015-Mar-05 19:00 
Generalsmallmoney Pin
pickron28-Feb-05 8:28
pickron28-Feb-05 8:28 
GeneralRe: smallmoney Pin
Rob Graham28-Feb-05 8:43
Rob Graham28-Feb-05 8:43 
GeneralRe: smallmoney Pin
pickron28-Feb-05 8:48
pickron28-Feb-05 8:48 
GeneralRe: smallmoney Pin
Luis Alonso Ramos28-Feb-05 18:46
Luis Alonso Ramos28-Feb-05 18:46 
QuestionHow do i run a system stored procedure Pin
Anonymous28-Feb-05 5:57
Anonymous28-Feb-05 5:57 
AnswerRe: How do i run a system stored procedure Pin
Rob Graham28-Feb-05 8:49
Rob Graham28-Feb-05 8:49 
GeneralRe: How do i run a system stored procedure Pin
Anonymous28-Feb-05 23:22
Anonymous28-Feb-05 23:22 
GeneralUpdate Table Pin
jetset3228-Feb-05 5:29
jetset3228-Feb-05 5:29 
GeneralRe: Update Table Pin
Yulianto.28-Feb-05 15:21
Yulianto.28-Feb-05 15:21 
GeneralRe: Update Table Pin
jetset3228-Feb-05 20:34
jetset3228-Feb-05 20:34 
GeneralJoin Table in 2 different database files Pin
ting66827-Feb-05 22:55
ting66827-Feb-05 22:55 
GeneralRe: Join Table in 2 different database files Pin
Yulianto.27-Feb-05 23:09
Yulianto.27-Feb-05 23:09 
GeneralRe: Join Table in 2 different database files Pin
ting66827-Feb-05 23:45
ting66827-Feb-05 23:45 
GeneralRe: Join Table in 2 different database files Pin
Yulianto.28-Feb-05 18:03
Yulianto.28-Feb-05 18:03 
GeneralProgramming Microsoft Outlook... two problems Pin
devvvy27-Feb-05 16:04
devvvy27-Feb-05 16:04 
GeneralUpdate an item in MySQL with VS2003 Pin
kd834127-Feb-05 15:21
kd834127-Feb-05 15:21 
I try to use ODBC to update an item in MySQL table "my_status", but it doesn't work. Seems the data can be loaded to the dataset, but how to write it back to the data sourse? Is there anybody can give me some ideas or samples on how to do this?

Here is my code:
/////connect to the database with DataSet
String* strSql = "SELECT * FROM my_status";
OdbcDataAdapter* da = new OdbcDataAdapter(strSql,MYSQLCONN);
OdbcCommandBuilder* custCB = new OdbcCommandBuilder(da);
OdbcCommand* cmd;
cmd = new OdbcCommand("Select * from my_status", MyConn);

da->SelectCommand = cmd;
DataSet* wrbtDS = new DataSet();
da->Fill(wrbtDS, "my_status");

DataRow* cRow = wrbtDS->Tables->Item["my_status"]->Rows->Item[0];

//// load the image into the dataset
String * FILE_NAME = "Solid.jpg"; // for inserting a image file
FileStream* fs = new FileStream(FILE_NAME, FileMode::Open, FileAccess::Read);
Int16 imglen = (int)fs->Length;
Byte buffer[] = new Byte[imglen];
fs->Read(buffer,0,buffer->Length);

cRow->Item["image"] = buffer;

/* until here the item["image"] is changed and shows in DataSet, but how to update the data source with this updated DataSet??????? The following code doesn't work and how to figure it out?*/


wrbtDS->Tables->Item["my_status"]->Rows->Item[0]->AcceptChanges();

da->Update(wrbtDS, "my_status");


Thanks a lot!

Kevin
QuestionHow to display menu in a child form of SQL Server Enterprise Manager Pin
xshi00527-Feb-05 9:22
xshi00527-Feb-05 9:22 
GeneralSyntax error on IF ELSE statement Pin
rudemusik27-Feb-05 7:22
rudemusik27-Feb-05 7:22 
GeneralRandom data Pin
vuthaianh26-Feb-05 17:00
vuthaianh26-Feb-05 17:00 

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.