Hi,
"Vayse" <vayse@nospam.nospam> wrote in message
news:OiRsJF0$FHA.140@TK2MSFTNGP12.phx.gbl...[color=blue]
> Thanks. This is single user system at this point, so its not that.
> The user enters the AssetCode, which is the primary key, so its not that
> either.[/color]
Yeah, that's strange. Are you doing anything special; changing keys,
changing any of the generated commands manually ? You also mentioned that it
fails on the same row, what are you doing before/when it fails ?
[color=blue]
> The update command is large, is there a way for me to write a shorter
> version?[/color]
You can turn off "Optimistic Concurrency" and then the WHERE clause will
only include the pk. You could try this to see if the problem goes away,
but it shouldn't be necesairy to turn it off since nobody else is changing
the record so you shouldn't get a concurrency violation in the first place.
You can change Concurrency Control if you (re)configure the TableAdapter:
Menu->Data->Show Data Sources
Right click on your AsserSetDataSet and choose "Edit DataSet with Designer".
You should visually see your DataTable and TableAdapter.
Right click the TableAdapter and choose Configure.
Click on "Advanced Options..." and uncheck "Use Optimistic Concurrency".
Finish the wizard.
[color=blue]
> I got the command via the partial class you sent. Is AssetSet.Designer.vb
> the correct location for me to add the partial class?[/color]
Don't think you're supposed to put it there, any other file will do.
HTH,
Greetings
[color=blue]
>
> Thanks
> Vayse
>
>
>
>
> UPDATE `Assets` SET `AssetCode` = ?, `Desc` = ?, `SubCategoryId` = ?,
> `PurchaseDate` = ?, `SuppliersCode` = ?, `PurchasePrice` = ?, `CostCentre`
> = ?, `Department` = ?, `Location1` = ?, `Location2` = ?, `Location3` = ?,
> `DeprAmount` = ?, `DeprStart` = ?, `DeprMethod` = ?, `DeprLife` = ?,
> `RemainingLife` = ?, `DeprFirstPeriod` = ?, `DeprResidual` = ?,
> `AccumDepr` = ?, `HasSchedule` = ?, `StatusID` = ?, `AssetNote` = ?,
> `AssetImage` = ?, `DisposalSIN` = ?, `DisposalNom` = ?, `SalesValue` = ?,
> `SerialNum` = ?, `Ins_Renewal` = ?, `Ins_CompanyId` = ?, `Ins_PolicyNum` =
> ?, `Tax_Renewal` = ?, `NCT_Renewal` = ? WHERE ((`AssetCode` = ?) AND ((? =
> 1 AND `Desc` IS NULL) OR (`Desc` = ?)) AND ((? = 1 AND `SubCategoryId` IS
> NULL) OR (`SubCategoryId` = ?)) AND ((? = 1 AND `PurchaseDate` IS NULL) OR
> (`PurchaseDate` = ?)) AND ((? = 1 AND `SuppliersCode` IS NULL) OR
> (`SuppliersCode` = ?)) AND ((? = 1 AND `PurchasePrice` IS NULL) OR
> (`PurchasePrice` = ?)) AND ((? = 1 AND `CostCentre` IS NULL) OR
> (`CostCentre` = ?)) AND ((? = 1 AN
> D `Department` IS NULL) OR (`Department` = ?)) AND ((? = 1 AND `Location1`
> IS NULL) OR (`Location1` = ?)) AND ((? = 1 AND `Location2` IS NULL) OR
> (`Location2` = ?)) AND ((? = 1 AND `Location3` IS NULL) OR (`Location3` =
> ?)) AND ((? = 1 AND `DeprAmount` IS NULL) OR (`DeprAmount` = ?)) AND ((? =
> 1 AND `DeprStart` IS NULL) OR (`DeprStart` = ?)) AND ((? = 1 AND
> `DeprMethod` IS NULL) OR (`DeprMethod` = ?)) AND ((? = 1 AND `DeprLife` IS
> NULL) OR (`DeprLife` = ?)) AND ((? = 1 AND `RemainingLife` IS NULL) OR
> (`RemainingLife` = ?)) AND ((? = 1 AND `DeprFirstPeriod` IS NULL) OR
> (`DeprFirstPeriod` = ?)) AND ((? = 1 AND `DeprResidual` IS NULL) OR
> (`DeprResidual` = ?)) AND ((? = 1 AND `AccumDepr` IS NULL) OR (`AccumDepr`
> = ?)) AND ((? = 1 AND `HasSchedule` IS NULL) OR (`HasSchedule` = ?)) AND
> ((? = 1 AND `StatusID` IS NULL) OR (`StatusID` = ?)) AND ((? = 1 AND
> `AssetNote` IS NULL) OR (`AssetNote` = ?)) AND ((? = 1 AND `AssetImage` IS
> NULL) OR (`AssetImage` = ?)) AND ((? = 1 AND `DisposalSIN` IS NULL) OR
> (`DisposalSIN` = ?)
> ) AND ((? = 1 AND `DisposalNom` IS NULL) OR (`DisposalNom` = ?)) AND ((? =
> 1 AND `SalesValue` IS NULL) OR (`SalesValue` = ?)) AND ((? = 1 AND
> `SerialNum` IS NULL) OR (`SerialNum` = ?)) AND ((? = 1 AND `Ins_Renewal`
> IS NULL) OR (`Ins_Renewal` = ?)) AND ((? = 1 AND `Ins_CompanyId` IS NULL)
> OR (`Ins_CompanyId` = ?)) AND ((? = 1 AND `Ins_PolicyNum` IS NULL) OR
> (`Ins_PolicyNum` = ?)) AND ((? = 1 AND `Tax_Renewal` IS NULL) OR
> (`Tax_Renewal` = ?)) AND ((? = 1 AND `NCT_Renewal` IS NULL) OR
> (`NCT_Renewal` = ?)))
>
>
> "Bart Mermuys" <bmermuys.nospam@hotmail.com> wrote in message
> news:u9UvLRC$FHA.3096@tk2msftngp13.phx.gbl...[color=green]
>> Hi,
>>
>> "Vayse" <vayse@nospam.nospam> wrote in message
>> news:OkHrGl%23%23FHA.208@tk2msftngp13.phx.gbl...[/color]
>
>[/color]