Click here to Skip to main content
15,909,827 members
Home / Discussions / C#
   

C#

 
QuestionReopen Tree after update? Pin
Snowjim13-Jan-05 7:09
Snowjim13-Jan-05 7:09 
AnswerRe: Reopen Tree after update? Pin
Charlie Williams13-Jan-05 8:21
Charlie Williams13-Jan-05 8:21 
AnswerRe: Reopen Tree after update? Pin
Robert Rohde13-Jan-05 9:39
Robert Rohde13-Jan-05 9:39 
GeneralMaintaining scroll position in a list box Pin
Member 164882913-Jan-05 6:25
Member 164882913-Jan-05 6:25 
Generalproblem with two form Pin
Newbie_Toy13-Jan-05 6:17
Newbie_Toy13-Jan-05 6:17 
GeneralGPRS Emulator Pin
Identity Undisclosed13-Jan-05 5:27
Identity Undisclosed13-Jan-05 5:27 
GeneralRe: GPRS Emulator Pin
Dave Kreskowiak13-Jan-05 8:14
mveDave Kreskowiak13-Jan-05 8:14 
Generaldataadapter.update problem Pin
Member 152458813-Jan-05 5:25
Member 152458813-Jan-05 5:25 
Hi I am reposting the following message in case anyone can help,
I am creating a generic data access module for an application and I
have come across the following problem:


A form calls the function that loads data from a table to a grid. Then
the code below is called in order to effect any changes in the dataset.
The problem appears with a table that has 43 columns. When in the
selectCommand I pass a select statement containing up to 32 columns it
works without problems. When I increase the number of columns it gives
a "Concurrency violation: the UpdateCommand affected 0 records."
exception. Is this some because of some limitation or am I making an
error in the code?


The table contains 4555 records


public void SaveDataFromGrid(DataSet dsName, string dtName, string
selectCommand)



{


//DGM 20040109
//This code works only for single table updates.


//Create new Connection
OdbcConnection dbConnection = new OdbcConnection(strConnectionString);


//Set the sql command that will fill the dataset
OdbcCommand sqlCommand = new OdbcCommand(selectCommand, dbConnection);
sqlCommand.CommandTimeout = 30;


//Set the sql command that will update the dataset


//Set the data adapter
OdbcDataAdapter dbDataAdapter = new OdbcDataAdapter();
OdbcCommandBuilder cb = new OdbcCommandBuilder(dbDataAdapter);
dbDataAdapter.SelectCommand = sqlCommand;


//Open the connection
dbConnection.Open();


//Fill the dataset with the data
dbDataAdapter.Update(dsName, dtName);


//Close the database connection
dbConnection.Close();
//return true;



}


Thanks in advance for the help
GeneralUserControl problem Pin
Daniel Zaharia13-Jan-05 5:15
Daniel Zaharia13-Jan-05 5:15 
GeneralRe: UserControl problem Pin
MoustafaS15-Jan-05 2:59
MoustafaS15-Jan-05 2:59 
Generalcreating map file or dump file for c# project Pin
anurik13-Jan-05 4:16
anurik13-Jan-05 4:16 
GeneralRe: creating map file or dump file for c# project Pin
Colin Angus Mackay13-Jan-05 5:42
Colin Angus Mackay13-Jan-05 5:42 
GeneralRe: creating map file or dump file for c# project Pin
Dave Kreskowiak13-Jan-05 8:10
mveDave Kreskowiak13-Jan-05 8:10 
Generalproblem displaying a usercontrol Pin
bobrad13-Jan-05 3:39
bobrad13-Jan-05 3:39 
Generalemail Pin
Mohammad Daba'an13-Jan-05 3:31
Mohammad Daba'an13-Jan-05 3:31 
GeneralRe: email Pin
Mazdak13-Jan-05 3:37
Mazdak13-Jan-05 3:37 
GeneralRe: email Pin
Mohammad Daba'an13-Jan-05 3:45
Mohammad Daba'an13-Jan-05 3:45 
GeneralRe: email Pin
Mazdak13-Jan-05 4:05
Mazdak13-Jan-05 4:05 
GeneralRe: email Pin
Mohammad Daba'an16-Jan-05 2:38
Mohammad Daba'an16-Jan-05 2:38 
Generalfonts in an assembly Pin
fickdb13-Jan-05 3:01
fickdb13-Jan-05 3:01 
GeneralRe: fonts in an assembly Pin
leppie13-Jan-05 5:04
leppie13-Jan-05 5:04 
GeneralCapture keyboard input Pin
Begoña13-Jan-05 1:39
Begoña13-Jan-05 1:39 
GeneralRe: Capture keyboard input Pin
Mazdak13-Jan-05 1:48
Mazdak13-Jan-05 1:48 
GeneralRe: Capture keyboard input Pin
Begoña13-Jan-05 2:39
Begoña13-Jan-05 2:39 
GeneralRe: Capture keyboard input Pin
Mazdak13-Jan-05 3:27
Mazdak13-Jan-05 3:27 

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.