Hi Miha,
Thanks for the response...I was beginning to worry. <g>
Anyway, below is my UpdateCommand:
daATBD.UpdateCommand = new OleDbCommand("UPDATE ATBD SET
SCHOOLNUM=@SCHOOLNUM, TABLETYPE=@TABLETYPE, TABLEDESC=@TABLEDESC,
CODEHEAD=@CODEHEAD, DESCHEAD=@DESCHEAD, CODELENGTH=@CODELENGTH,
DESCLENGTH=@DESCLENGTH, SECURITY=@SECURITY,
FIELDTYPE=@FIELDTYPE,TABLEGRP=@TABLEGRP WHERE
TABLETYPE=@TABLETYPE",cn);
Param = daATBD.UpdateCommand.Parameters.Add(new
OleDbParameter("@SCHOOLNUM", OleDbType.VarChar));
Param.SourceColumn = "SCHOOLNUM";
Param.SourceVersion = DataRowVersion.Original;
Param = daATBD.UpdateCommand.Parameters.Add(new
OleDbParameter("@TABLETYPE", OleDbType.VarChar));
Param.SourceColumn = "TABLETYPE";
Param.SourceVersion = DataRowVersion.Original;
Param = daATBD.UpdateCommand.Parameters.Add(new
OleDbParameter("@TABLEDESC", OleDbType.VarChar));
Param.SourceColumn = "TABLEDESC";
Param.SourceVersion = DataRowVersion.Original;
Param = daATBD.UpdateCommand.Parameters.Add(new
OleDbParameter("@CODEHEAD", OleDbType.VarChar));
Param.SourceColumn = "CODEHEAD";
Param.SourceVersion = DataRowVersion.Original;
Param = daATBD.UpdateCommand.Parameters.Add(new
OleDbParameter("@DESCHEAD", OleDbType.VarChar));
Param.SourceColumn = "DESCHEAD";
Param.SourceVersion = DataRowVersion.Original;
Param = daATBD.UpdateCommand.Parameters.Add(new
OleDbParameter("@CODELENGTH", OleDbType.Numeric));
Param.SourceColumn = "CODELENGTH";
Param.SourceVersion = DataRowVersion.Original;
Param = daATBD.UpdateCommand.Parameters.Add(new
OleDbParameter("@DESCLENGTH", OleDbType.Numeric));
Param.SourceColumn = "DESCLENGTH";
Param.SourceVersion = DataRowVersion.Original;
Param = daATBD.UpdateCommand.Parameters.Add(new
OleDbParameter("@SECURITY", OleDbType.VarChar));
Param.SourceColumn = "SECURITY";
Param.SourceVersion = DataRowVersion.Original;
Param = daATBD.UpdateCommand.Parameters.Add(new
OleDbParameter("@FIELDTYPE", OleDbType.Numeric));
Param.SourceColumn = "FIELDTYPE";
Param.SourceVersion = DataRowVersion.Original;
Param = daATBD.UpdateCommand.Parameters.Add(new
OleDbParameter("@TABLEGRP", OleDbType.VarChar));
Param.SourceColumn = "TABLEGRP";
Param.SourceVersion = DataRowVersion.Original;
// My work table
DataTable workTable=myDataSet.Tables[MyTable];
// doing the following actually shows me that I have modified rows...
DataRow[] drs = workTable.Select(null,null,DataViewRowState.ModifiedCurrent);
for(int i=0;i<foundRows.Length;++i)
{
DataRow dr=(DataRow)foundRows
;
string original=dr["TABLEDESC",DataRowVersion.Original].ToString();
string current=dr["TABLEDESC",DataRowVersion.Current].ToString();
}
"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
Hi mark,
How does your Update commad look like?
How does your workTable look like?
--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com
I have written my own DataAdapter for my DBase IV file(s). The
Insert, Update and Delete calls all report success when I call
Update(...) on the DataAdapter. Unfortunately, when I recall the
data, only the Inserts and Deletes actually worked. For some reason,
the UpdateCommand is returning the correct number of records that were
affected according to the Update call:
nUpdates=daATBD.Update(workTable.Select(null,null,DataViewRowState.ModifiedC
urrent));
but the changes are just not there...
I've tried everything that I can think of, including doing an combo
(Delete/Insert) for every Update, but that isn't going to work
either...
What gives?
Thanks in advance,
Mark Feferman
(e-mail address removed)