Click here to Skip to main content
15,920,438 members
Home / Discussions / C#
   

C#

 
GeneralRe: Very Slow Startup Time Pin
goodpilot11-Jan-05 17:23
goodpilot11-Jan-05 17:23 
GeneralManipulate Excel-Files with C# Pin
Thunderclap0111-Jan-05 1:29
Thunderclap0111-Jan-05 1:29 
GeneralDisplay time in DataGrid column Pin
Anonymous11-Jan-05 0:58
Anonymous11-Jan-05 0:58 
GeneralRe: Display time in DataGrid column Pin
Robert Rohde11-Jan-05 1:42
Robert Rohde11-Jan-05 1:42 
GeneralRe: Display time in DataGrid column Pin
Anonymous11-Jan-05 19:59
Anonymous11-Jan-05 19:59 
GeneralDatabases, ListBoxes and UniqueID's Pin
Harold Clements11-Jan-05 0:38
Harold Clements11-Jan-05 0:38 
GeneralRe: Databases, ListBoxes and UniqueID's Pin
Robert Rohde11-Jan-05 1:51
Robert Rohde11-Jan-05 1:51 
GeneralProblem with the OdbcDataAdapter.Update Pin
10-Jan-05 23:39
suss10-Jan-05 23:39 
Hi,
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
QuestionCan I embed MS Words into my c# local app? Pin
Joshscorp10-Jan-05 23:34
Joshscorp10-Jan-05 23:34 
GeneralWMEncoder saving file Pin
RockRock10-Jan-05 22:30
RockRock10-Jan-05 22:30 
GeneralFax Modem !!!!!!!! Pin
Mr.Cooper10-Jan-05 22:25
Mr.Cooper10-Jan-05 22:25 
GeneralInterop.Microsoft.Office.Core Pin
dabuskol10-Jan-05 22:21
dabuskol10-Jan-05 22:21 
GeneralXML from Dataset Pin
dotnetquery10-Jan-05 21:38
dotnetquery10-Jan-05 21:38 
Generalgarbage collector Pin
sianatia10-Jan-05 21:28
sianatia10-Jan-05 21:28 
GeneralRe: garbage collector Pin
Colin Angus Mackay11-Jan-05 0:20
Colin Angus Mackay11-Jan-05 0:20 
Generalrtf help Pin
Mohammad Daba'an10-Jan-05 21:27
Mohammad Daba'an10-Jan-05 21:27 
GeneralException messages in multilingual environment Pin
Ami Bar10-Jan-05 21:12
Ami Bar10-Jan-05 21:12 
GeneralCrystal Report Image Parameter (C#) Pin
Craig G Fraser10-Jan-05 20:42
Craig G Fraser10-Jan-05 20:42 
GeneralStreaming Pin
RockRock10-Jan-05 19:30
RockRock10-Jan-05 19:30 
GeneralRe: Streaming Pin
Heath Stewart10-Jan-05 19:46
protectorHeath Stewart10-Jan-05 19:46 
GeneralPen Color Change Pin
ninja260510-Jan-05 18:57
ninja260510-Jan-05 18:57 
GeneralRe: Pen Color Change Pin
Heath Stewart10-Jan-05 20:23
protectorHeath Stewart10-Jan-05 20:23 
GeneralRe: Pen Color Change Pin
Robert Rohde10-Jan-05 20:26
Robert Rohde10-Jan-05 20:26 
QuestionMemory Leak in C# SDI App? Pin
pcJuice10-Jan-05 15:22
pcJuice10-Jan-05 15:22 
AnswerRe: Memory Leak in C# SDI App? Pin
Victor Campos10-Jan-05 18:18
Victor Campos10-Jan-05 18:18 

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.