Re: OleDbDataAdapter.Update and DBase IV
From: Miha Markic [MVP C#] (miha)
Date: 03/01/04
- Next message: Elyo Ravuna: "Timeout after 6 hours (SqlCommand object)"
- Previous message: William \(Bill\) Vaughn: "Re: OleDb and .NET"
- In reply to: mark: "Re: OleDbDataAdapter.Update and DBase IV"
- Next in thread: mark: "Re: OleDbDataAdapter.Update and DBase IV"
- Reply: mark: "Re: OleDbDataAdapter.Update and DBase IV"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 1 Mar 2004 16:09:41 +0100
Hi mark,
I think that your problem is that you have @tabletype defined only once, so
the second one is always null.
BTW you might avoid changing TABLETYPE as it is unique?
--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com
"mark" <mfeferman@houston.rr.com> wrote in message
news:eac0380.0403010654.64706816@posting.google.com...
> 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[i];
> 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
news:<Ojp7Mp2$DHA.2808@TK2MSFTNGP10.phx.gbl>...
> > 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
> >
> > "mark" <mfeferman@houston.rr.com> wrote in message
> > news:eac0380.0402271334.3fa9618b@posting.google.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
> > > mfeferman@houston.rr.com
- Next message: Elyo Ravuna: "Timeout after 6 hours (SqlCommand object)"
- Previous message: William \(Bill\) Vaughn: "Re: OleDb and .NET"
- In reply to: mark: "Re: OleDbDataAdapter.Update and DBase IV"
- Next in thread: mark: "Re: OleDbDataAdapter.Update and DBase IV"
- Reply: mark: "Re: OleDbDataAdapter.Update and DBase IV"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|