Click here to Skip to main content
15,921,382 members
Home / Discussions / Database
   

Database

 
AnswerRe: Multiple Header DataGrid....anyone?? Pin
Marcie Jones10-Feb-04 6:46
Marcie Jones10-Feb-04 6:46 
GeneralSQL Server problem Pin
srt76-Feb-04 9:47
srt76-Feb-04 9:47 
GeneralRe: SQL Server problem Pin
Hesham Amin8-Feb-04 8:40
Hesham Amin8-Feb-04 8:40 
GeneralAdapter Update function not working for me. Pin
Michael A. Barnhart6-Feb-04 4:31
Michael A. Barnhart6-Feb-04 4:31 
GeneralRe: Adapter Update function not working for me. Pin
Michael A. Barnhart6-Feb-04 13:24
Michael A. Barnhart6-Feb-04 13:24 
GeneralRe: Adapter Update function not working for me. Pin
Bill Dean6-Feb-04 17:11
Bill Dean6-Feb-04 17:11 
GeneralRe: Adapter Update function not working for me. Pin
Michael A. Barnhart7-Feb-04 15:25
Michael A. Barnhart7-Feb-04 15:25 
GeneralRe: Adapter Update function not working for me. Pin
Bill Dean7-Feb-04 16:28
Bill Dean7-Feb-04 16:28 
Hi Michael,

ok...so you dragged a dataadapter from the toolbox to the form? Or did you drag the table onto the form from the Server Explorer? I am guessing from your previous response that you dragged the blank dataadapter from the toolbox...yes?

Forgive me if I am being too basic here....
A dataadapter has four Command objects associated with it: select, insert, update and delete commands. If you construct the dataadapter in code by specifying the sql command in a string along with the connectionstring it ONLY generates the SELECT command.

I've never used the OdbcDataAdapter, but for the OLEDB and SQL dataadapters, there is a CommandBuilder class that will generate the other 3 commands for you (provided the table has a primary key).

Before you do the update, in your CommitButton_Click method:
OdbcCommandBuilder CB = new OdbcCommandBuilder(m_dataAdapter);

Creating CB should create the other three commands on m_dataAdapter, so the update should work.

Good luck,
Bill

ps: see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataodbcodbccommandbuilderclasstopic.asp
GeneralRe: Adapter Update function not working for me. Pin
Michael A. Barnhart8-Feb-04 9:17
Michael A. Barnhart8-Feb-04 9:17 
GeneralRe: Adapter Update function not working for me. Pin
Gigiwig13-Feb-04 23:52
Gigiwig13-Feb-04 23:52 
GeneralRe: Adapter Update function not working for me. Pin
Gigiwig14-Feb-04 0:02
Gigiwig14-Feb-04 0:02 
GeneralA quick question on table variables Pin
PrashantJ6-Feb-04 0:11
PrashantJ6-Feb-04 0:11 
GeneralRe: A quick question on table variables Pin
Mike Dimmick6-Feb-04 5:08
Mike Dimmick6-Feb-04 5:08 
GeneralProblem with VB6 and SQL Server 2000 Pin
gamerPotatoe5-Feb-04 22:40
gamerPotatoe5-Feb-04 22:40 
GeneralRe: Problem with VB6 and SQL Server 2000 Pin
Mazdak5-Feb-04 23:04
Mazdak5-Feb-04 23:04 
GeneralRe: Problem with VB6 and SQL Server 2000 Pin
Mike Dimmick5-Feb-04 23:06
Mike Dimmick5-Feb-04 23:06 
GeneralQuery Pin
girl_lash5-Feb-04 15:13
girl_lash5-Feb-04 15:13 
GeneralRe: Query Pin
Steve S10-Feb-04 6:21
Steve S10-Feb-04 6:21 
Generalsimple INSERT question Pin
hkl5-Feb-04 9:12
hkl5-Feb-04 9:12 
GeneralRe: simple INSERT question Pin
Edbert P5-Feb-04 19:07
Edbert P5-Feb-04 19:07 
GeneralConfigure SMTP Pin
DaKhucBuon4-Feb-04 23:08
DaKhucBuon4-Feb-04 23:08 
GeneralRe: Configure SMTP Pin
Vasudevan Deepak Kumar5-Feb-04 0:37
Vasudevan Deepak Kumar5-Feb-04 0:37 
GeneralRe: Configure SMTP Pin
DaKhucBuon5-Feb-04 14:40
DaKhucBuon5-Feb-04 14:40 
GeneralRe: Configure SMTP Pin
Vasudevan Deepak Kumar6-Feb-04 0:53
Vasudevan Deepak Kumar6-Feb-04 0:53 
GeneralAccess/ODBC: Item count fails Pin
mexicanchili4-Feb-04 21:51
mexicanchili4-Feb-04 21:51 

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.