Re: Stupid Question - I think!
- From: "Bill" <Bill@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 May 2005 06:41:13 -0700
Earl,
I know that the table was not updated because I go to the Query Analyzer on
the PDA and examine the contents of the table after running my app. Also the
update statement shown below does run in the Query Analyzer on the PDA
(against the CE database) and does produce the desired result.
As for back end issues, this table does have a trigger, but the trigger does
not restrict the column I'm updateing in any way. I assume (perhaps
erroneously) that the trigger doesn't replicate anyway.
Bill
"Earl" wrote:
> A preliminary question: how do you know the CE database is not executing an
> update? Are you checking this in the Query Analyzer after you run the code?
> You could also try to execute an update using the Query Analyzer to confirm
> your Update statement executes properly.
>
> There are many potential pitfalls with replication. I too had some SQLCE
> update problems that were not code related at all, rather the issue was with
> the backend database structure.
>
> "Bill" <Bill@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:E7F721DB-DD6C-466C-84D5-4858B26248B3@xxxxxxxxxxxxxxxx
> > Ok, so I managed to get merge replication working and I have a single
> > table
> > in a database out on my PDA. I now want to change a row in the table and
> > synch back to the main database. I'm trying to the easy part - use
> > System.Data.SqlServerCe to update the table but I can't get the blasted
> > table
> > to update! Here is my code, the update statement works and produces the
> > correct results if I run it in Query Analyzer against the main database.
> > If
> > the code below is run on the PDA against the CE database no exceptions are
> > thrown, and no rows are updated. Have I goofed up this code?
> >
> > Bill
> >
> >
> > try
> > {
> > SqlCeConnection cn = new SqlCeConnection( @"Data Source=\My
> > Documents\oxsite.sdf" );
> >
> > string str = "UPDATE cioxsitelist SET oxsitelabel = 'Kilroy was here'
> > WHERE oxsitecode = 66";
> > SqlCeCommand cmd = new SqlCeCommand( str, cn );
> > cmd.CommandType = CommandType.Text;
> > cn.Open();
> > cmd.ExecuteNonQuery();
> > cmd.Connection.Close();
> > }
> > catch( SqlCeException sex )
> > {
> > foreach( SqlCeError err in sex.Errors )
> > {
> > MessageBox.Show( err.Message, "SQL CE Error" );
> > }
> > }
> > catch( Exception ex )
> > {
> > MessageBox.Show( ex.Message, "Error" );
> > }
> >
>
>
>
.
- References:
- Stupid Question - I think!
- From: Bill
- Re: Stupid Question - I think!
- From: Earl
- Stupid Question - I think!
- Prev by Date: Re: sqlcereplication error
- Next by Date: Is SQL Server CE free??
- Previous by thread: Re: Stupid Question - I think!
- Next by thread: Is SQL Server CE free??
- Index(es):
Relevant Pages
|