473,614 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SqlDataSource and Optimistic Concurrency Problems

Hi,

I'm using a detailsview control with an SqlDataSource control. My
Update query isn't working, and I've narrowed it down to the optimistic
concurrency parameters - i.e. when I comment them out of the query, it
works. What seems to be happening is that if a field is NULL when it
is read in through the select statement, it's causing the update
statment not to find a match. I've got ConvertEmptyStr ingToNull not
set (so it should default to true), but I can't get the update to work
all the time and it's driving me crazy.

Here's my code:

Stored Procedure for Select as follows (the Update's going in a Stored
Procedure when I can get it to work...):
SELECT Customers.CustI D, Customers.CustD isplayName,
Customers.CustF irstName, Customers.CustS urname, Customers.CustT ype,
Customers.CustN otes, Customers.CustI sBillingSame,
Customers.CustN umEmployees, Customers.CustI sProspect,
Customers.CustO nHold, Customers.CustP ersonID,
Customers.CustU serFieldB1, Customers.CustU serFieldB2,
Customers.CustU serFieldB3, Customers.CustU serFieldD1,
Customers.CustU serFieldD2, Customers.CustU serFieldD3,
Customers.CustU serFieldI1, Customers.CustU serFieldI2,
Customers.CustU serFieldI3, Customers.CustC ategory,
Customers.CustI nactive, CustomerContact Details_1.CustC ontactStreet1,
CustomerContact Details_1.CustC ontactStreet2,
CustomerContact Details_1.CustC ontactStreet3,
CustomerContact Details_1.CustC ontactTown,
CustomerContact Details_1.CustC ontactCounty,
CustomerContact Details_1.CustC ontactPostCode,
CustomerContact Details_1.CustC ontactCountry,
CustomerContact Details_1.CustC ontactTelephone ,
CustomerContact Details_1.CustC ontactMobile,
CustomerContact Details_1.CustC ontactEMail,
CustomerContact Details_1.CustC ontactFax,
CustomerContact Details.CustCon tactStreet1 AS CustBContactStr eet1,
CustomerContact Details.CustCon tactStreet2 AS CustBContactStr eet2,
CustomerContact Details.CustCon tactStreet3 AS CustBContactStr eet3,
CustomerContact Details.CustCon tactTown AS CustBContactTow n,
CustomerContact Details.CustCon tactCounty AS CustBContactCou nty,
CustomerContact Details.CustCon tactPostCode AS CustBContactPos tCode,
CustomerContact Details.CustCon tactCountry AS CustBContactCou ntry,
CustomerContact Details.CustCon tactTelephone AS CustBContactTel ephone,
CustomerContact Details.CustCon tactMobile AS CustBContactMob ile,
CustomerContact Details.CustCon tactEMail AS CustBContactEMa il,
CustomerContact Details.CustCon tactFax AS CustBContactFax FROM Customers
LEFT OUTER JOIN CustomerContact Details AS CustomerContact Details_1 ON
Customers.CustA ddressID = CustomerContact Details_1.CustC ontactID LEFT
OUTER JOIN CustomerContact Details ON Customers.CustB illingID =
CustomerContact Details.CustCon tactID WHERE (Customers.Cust ID = @CustID)
<asp:SqlDataSou rce ID="SqlDataSour ce2" runat="server"
ConflictDetecti on="CompareAllV alues"
ConnectionStrin g="<%$
ConnectionStrin gs:FocusSystems ConnectionStrin g %>"
OldValuesParame terFormatString ="original_{ 0}"
ProviderName="< %$
ConnectionStrin gs:FocusSystems ConnectionStrin g.ProviderName %>"
SelectCommand=" SelectCustomers AndAddresses"
SelectCommandTy pe="StoredProce dure"
UpdateCommand=" UPDATE [Customers] SET
[CustDisplayName] = @CustDisplayNam e, [CustFirstName] = @CustFirstName,
[CustSurname] = @CustSurname, [CustType] = @CustType, [CustNotes] =
@CustNotes, [CustIsBillingSa me] = @CustIsBillingS ame,
[CustNumEmployee s] = @CustNumEmploye es, [CustIsProspect] =
@CustIsProspect , [CustOnHold] = @CustOnHold, [CustPersonID] =
@CustPersonID, [CustUserFieldB1] = @CustUserFieldB 1, [CustUserFieldB2]
= @CustUserFieldB 2, [CustUserFieldB3] = @CustUserFieldB 3,
[CustUserFieldD1] = @CustUserFieldD 1, [CustUserFieldD2] =
@CustUserFieldD 2, [CustUserFieldD3] = @CustUserFieldD 3,
[CustUserFieldI1] = @CustUserFieldI 1, [CustUserFieldI2] =
@CustUserFieldI 2, [CustUserFieldI3] = @CustUserFieldI 3, [CustCategory]
= @CustCategory, [CustInactive] = @CustInactive WHERE [CustID] =
@original_CustI D AND [CustDisplayName] = @original_CustD isplayName AND
[CustFirstName] = @original_CustF irstName AND [CustSurname] =
@original_CustS urname AND [CustType] = @original_CustT ype AND
[CustIsBillingSa me] = @original_CustI sBillingSame AND
[CustNumEmployee s] = @original_CustN umEmployees AND [CustIsProspect] =
@original_CustI sProspect AND [CustOnHold] = @original_CustO nHold AND
[CustPersonID] = @original_CustP ersonID AND [CustCategory] =
@original_CustC ategory AND [CustInactive] = @original_CustI nactive"
EnableViewState ="true">
<UpdateParamete rs>
<asp:Paramete r Name="CustDispl ayName"
Type="String" />
<asp:Paramete r Name="CustFirst Name"
Type="String" />
<asp:Paramete r Name="CustSurna me" Type="String"
/>
<asp:Paramete r Name="CustType" Type="String" />
<asp:Paramete r Name="CustNotes " Type="String"
/>
<asp:Paramete r Name="CustIsBil lingSame"
Type="Boolean" />
<asp:Paramete r Name="CustNumEm ployees"
Type="Int32" />
<asp:Paramete r Name="CustIsPro spect"
Type="Boolean" />
<asp:Paramete r Name="CustOnHol d" Type="Boolean"
/>
<asp:Paramete r Name="CustPerso nID" />
<asp:Paramete r Name="CustUserF ieldB1"
Type="String" />
<asp:Paramete r Name="CustUserF ieldB2"
Type="String" />
<asp:Paramete r Name="CustUserF ieldB3"
Type="String" />
<asp:Paramete r Name="CustUserF ieldD1"
Type="String" />
<asp:Paramete r Name="CustUserF ieldD2"
Type="String" />
<asp:Paramete r Name="CustUserF ieldD3"
Type="String" />
<asp:Paramete r Name="CustUserF ieldI1"
Type="String" />
<asp:Paramete r Name="CustUserF ieldI2"
Type="String" />
<asp:Paramete r Name="CustUserF ieldI3"
Type="String" />
<asp:Paramete r Name="CustCateg ory"
Type="String" />
<asp:Paramete r Name="CustInact ive"
Type="Boolean" />
<asp:Paramete r Name="original_ CustID" />
<asp:Paramete r Name="original_ CustDisplayName "
/>
<asp:Paramete r Name="original_ CustFirstName" />
<asp:Paramete r Name="original_ CustSurname" />
<asp:Paramete r Name="original_ CustType" />
<asp:Paramete r Name="original_ CustNotes" />
<asp:Paramete r
Name="original_ CustIsBillingSa me" />
<asp:Paramete r Name="original_ CustNumEmployee s"
/>
<asp:Paramete r Name="original_ CustIsProspect"
/>
<asp:Paramete r Name="original_ CustOnHold" />
<asp:Paramete r Name="original_ CustPersonID" />
<asp:Paramete r Name="original_ CustUserFieldB1 "
/>
<asp:Paramete r Name="original_ CustUserFieldB2 "
/>
<asp:Paramete r Name="original_ CustUserFieldB3 "
/>
<asp:Paramete r Name="original_ CustUserFieldD1 "
/>
<asp:Paramete r Name="original_ CustUserFieldD2 "
/>
<asp:Paramete r Name="original_ CustUserFieldD3 "
/>
<asp:Paramete r Name="original_ CustUserFieldI1 "
/>
<asp:Paramete r Name="original_ CustUserFieldI2 "
/>
<asp:Paramete r Name="original_ CustUserFieldI3 "
/>
<asp:Paramete r Name="original_ CustCategory" />
<asp:Paramete r Name="original_ CustInactive" />
<asp:Paramete r Name="CustConta ctStreet1"
Type="String" />
<asp:Paramete r Name="CustConta ctStreet2"
Type="String" />
<asp:Paramete r Name="CustConta ctStreet3"
Type="String" />
<asp:Paramete r Name="CustConta ctTown"
Type="String" />
<asp:Paramete r Name="CustConta ctCounty"
Type="String" />
<asp:Paramete r Name="CustConta ctPostCode"
Type="String" />
<asp:Paramete r Name="CustConta ctCountry"
Type="String" />
<asp:Paramete r Name="CustConta ctTelephone"
Type="String" />
<asp:Paramete r Name="CustConta ctMobile"
Type="String" />
<asp:Paramete r Name="CustConta ctEMail"
Type="String" />
<asp:Paramete r Name="CustConta ctFax"
Type="String" />
<asp:Paramete r
Name="original_ CustContactStre et1" Type="String" />
<asp:Paramete r
Name="original_ CustContactStre et2" Type="String" />
<asp:Paramete r
Name="original_ CustContactStre et3" Type="String" />
<asp:Paramete r Name="original_ CustContactTown "
Type="String" />
<asp:Paramete r
Name="original_ CustContactCoun ty" Type="String" />
<asp:Paramete r
Name="original_ CustContactPost Code" Type="String" />
<asp:Paramete r
Name="original_ CustContactCoun try" Type="String" />
<asp:Paramete r
Name="original_ CustContactTele phone" Type="String" />
<asp:Paramete r
Name="original_ CustContactMobi le" Type="String" />
<asp:Paramete r Name="original_ CustContactEMai l"
Type="String" />
<asp:Paramete r Name="original_ CustContactFax"
Type="String" />
<asp:Paramete r Name="CustBCont actStreet1"
Type="String" />
<asp:Paramete r Name="CustBCont actStreet2"
Type="String" />
<asp:Paramete r Name="CustBCont actStreet3"
Type="String" />
<asp:Paramete r Name="CustBCont actTown"
Type="String" />
<asp:Paramete r Name="CustBCont actCounty"
Type="String" />
<asp:Paramete r Name="CustBCont actPostCode"
Type="String" />
<asp:Paramete r Name="CustBCont actCountry"
Type="String" />
<asp:Paramete r Name="CustBCont actTelephone"
Type="String" />
<asp:Paramete r Name="CustBCont actMobile"
Type="String" />
<asp:Paramete r Name="CustBCont actEMail"
Type="String" />
<asp:Paramete r Name="CustBCont actFax"
Type="String" />
<asp:Paramete r
Name="original_ CustBContactStr eet1" Type="String" />
<asp:Paramete r
Name="original_ CustBContactStr eet2" Type="String" />
<asp:Paramete r
Name="original_ CustBContactStr eet3" Type="String" />
<asp:Paramete r Name="original_ CustBContactTow n"
Type="String" />
<asp:Paramete r
Name="original_ CustBContactCou nty" Type="String" />
<asp:Paramete r
Name="original_ CustBContactPos tCode" Type="String" />
<asp:Paramete r
Name="original_ CustBContactCou ntry" Type="String" />
<asp:Paramete r
Name="original_ CustBContactTel ephone" Type="String" />
<asp:Paramete r
Name="original_ CustBContactMob ile" Type="String" />
<asp:Paramete r
Name="original_ CustBContactEMa il" Type="String" />
<asp:Paramete r Name="original_ CustBContactFax "
Type="String" />
</UpdateParameter s>
<SelectParamete rs>
<asp:ControlPar ameter
ControlID="Cust NameSelect" Name="CustID" PropertyName="S electedValue"
/>
</SelectParameter s>
</asp:SqlDataSour ce>
</td>
</tr>
<tr><td>
<asp:DetailsVie w ID="DetailsView 1" runat="server"
AutoGenerateRow s="False" DataSourceID="S qlDataSource2"
Height="50px" Width="125px" DataKeyNames="C ustID">
<Fields>
<asp:BoundFie ld DataField="Cust ID"
HeaderText="Cus tID" ReadOnly="True" SortExpression= "CustID" />
<asp:BoundFie ld DataField="Cust DisplayName"
HeaderText="Cus tDisplayName" SortExpression= "CustDisplayNam e" />
<asp:BoundFie ld DataField="Cust FirstName"
HeaderText="Cus tFirstName" SortExpression= "CustFirstN ame" />
<asp:BoundFie ld DataField="Cust Surname"
HeaderText="Cus tSurname" SortExpression= "CustSurnam e" />
<asp:BoundFie ld DataField="Cust Type"
HeaderText="Cus tType" SortExpression= "CustType" />
<asp:BoundFie ld DataField="Cust Notes"
HeaderText="Cus tNotes" SortExpression= "CustNotes" />
<asp:CheckBoxFi eld DataField="Cust IsBillingSame"
HeaderText="Cus tIsBillingSame" SortExpression= "CustIsBillingS ame" />
<asp:BoundFie ld DataField="Cust NumEmployees"
HeaderText="Cus tNumEmployees" SortExpression= "CustNumEmploye es" />
<asp:CheckBoxFi eld DataField="Cust IsProspect"
HeaderText="Cus tIsProspect" SortExpression= "CustIsProspect " />
<asp:CheckBoxFi eld DataField="Cust OnHold"
HeaderText="Cus tOnHold" SortExpression= "CustOnHold " />
<asp:BoundFie ld DataField="Cust PersonID"
HeaderText="Cus tPersonID" SortExpression= "CustPerson ID" />
<asp:BoundFie ld DataField="Cust UserFieldB1"
HeaderText="Cus tUserFieldB1" SortExpression= "CustUserFieldB 1" />
<asp:BoundFie ld DataField="Cust UserFieldB2"
HeaderText="Cus tUserFieldB2" SortExpression= "CustUserFieldB 2" />
<asp:BoundFie ld DataField="Cust UserFieldB3"
HeaderText="Cus tUserFieldB3" SortExpression= "CustUserFieldB 3" />
<asp:BoundFie ld DataField="Cust UserFieldD1"
HeaderText="Cus tUserFieldD1" SortExpression= "CustUserFieldD 1" />
<asp:BoundFie ld DataField="Cust UserFieldD2"
HeaderText="Cus tUserFieldD2" SortExpression= "CustUserFieldD 2" />
<asp:BoundFie ld DataField="Cust UserFieldD3"
HeaderText="Cus tUserFieldD3" SortExpression= "CustUserFieldD 3" />
<asp:BoundFie ld DataField="Cust UserFieldI1"
HeaderText="Cus tUserFieldI1" SortExpression= "CustUserFieldI 1" />
<asp:BoundFie ld DataField="Cust UserFieldI2"
HeaderText="Cus tUserFieldI2" SortExpression= "CustUserFieldI 2" />
<asp:BoundFie ld DataField="Cust UserFieldI3"
HeaderText="Cus tUserFieldI3" SortExpression= "CustUserFieldI 3" />
<asp:BoundFie ld DataField="Cust Category"
HeaderText="Cus tCategory" SortExpression= "CustCatego ry" />
<asp:CheckBoxFi eld DataField="Cust Inactive"
HeaderText="Cus tInactive" SortExpression= "CustInacti ve" />
<asp:BoundFie ld DataField="Cust ContactStreet1"
HeaderText="Cus tContactStreet1 " SortExpression= "CustContactStr eet1" />
<asp:BoundFie ld DataField="Cust ContactStreet2"
HeaderText="Cus tContactStreet2 " SortExpression= "CustContactStr eet2" />
<asp:BoundFie ld DataField="Cust ContactStreet3"
HeaderText="Cus tContactStreet3 " SortExpression= "CustContactStr eet3" />
<asp:BoundFie ld DataField="Cust ContactTown"
HeaderText="Cus tContactTown" SortExpression= "CustContactTow n" />
<asp:BoundFie ld DataField="Cust ContactCounty"
HeaderText="Cus tContactCounty" SortExpression= "CustContactCou nty" />
<asp:BoundFie ld DataField="Cust ContactPostCode "
HeaderText="Cus tContactPostCod e"
SortExpression= "CustContactPos tCode" />
<asp:BoundFie ld DataField="Cust ContactCountry"
HeaderText="Cus tContactCountry " SortExpression= "CustContactCou ntry" />
<asp:BoundFie ld DataField="Cust ContactTelephon e"
HeaderText="Cus tContactTelepho ne"
SortExpression= "CustContactTel ephone" />
<asp:BoundFie ld DataField="Cust ContactMobile"
HeaderText="Cus tContactMobile" SortExpression= "CustContactMob ile" />
<asp:BoundFie ld DataField="Cust ContactEMail"
HeaderText="Cus tContactEMail" SortExpression= "CustContactEMa il" />
<asp:BoundFie ld DataField="Cust ContactFax"
HeaderText="Cus tContactFax" SortExpression= "CustContactFax " />
<asp:BoundFie ld DataField="Cust BContactStreet1 "
HeaderText="Cus tBContactStreet 1"
SortExpression= "CustBContactSt reet1" />
<asp:BoundFie ld DataField="Cust BContactStreet2 "
HeaderText="Cus tBContactStreet 2"
SortExpression= "CustBContactSt reet2" />
<asp:BoundFie ld DataField="Cust BContactStreet3 "
HeaderText="Cus tBContactStreet 3"
SortExpression= "CustBContactSt reet3" />
<asp:BoundFie ld DataField="Cust BContactTown"
HeaderText="Cus tBContactTown" SortExpression= "CustBContactTo wn" />
<asp:BoundFie ld DataField="Cust BContactCounty"
HeaderText="Cus tBContactCounty " SortExpression= "CustBContactCo unty" />
<asp:BoundFie ld DataField="Cust BContactPostCod e"
HeaderText="Cus tBContactPostCo de"
SortExpression= "CustBContactPo stCode" />
<asp:BoundFie ld DataField="Cust BContactCountry "
HeaderText="Cus tBContactCountr y"
SortExpression= "CustBContactCo untry" />
<asp:BoundFie ld DataField="Cust BContactTelepho ne"
HeaderText="Cus tBContactTeleph one"
SortExpression= "CustBContactTe lephone" />
<asp:BoundFie ld DataField="Cust BContactMobile"
HeaderText="Cus tBContactMobile " SortExpression= "CustBContactMo bile" />
<asp:BoundFie ld DataField="Cust BContactEMail"
HeaderText="Cus tBContactEMail" SortExpression= "CustBContactEM ail" />
<asp:BoundFie ld DataField="Cust BContactFax"
HeaderText="Cus tBContactFax" SortExpression= "CustBContactFa x" />
<asp:CommandFie ld ShowEditButton= "True" />
</Fields>
</asp:DetailsView >

Jan 30 '06 #1
2 1584
When you say it isn't working, is it throwing an exception or is it just not
updating. From the looks of the Update query if I'm reading it correctly,
there's no where clause to specify which row you're going to update. Is that
intentional?
<st************ @gmail.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Hi,

I'm using a detailsview control with an SqlDataSource control. My
Update query isn't working, and I've narrowed it down to the optimistic
concurrency parameters - i.e. when I comment them out of the query, it
works. What seems to be happening is that if a field is NULL when it
is read in through the select statement, it's causing the update
statment not to find a match. I've got ConvertEmptyStr ingToNull not
set (so it should default to true), but I can't get the update to work
all the time and it's driving me crazy.

Here's my code:

Stored Procedure for Select as follows (the Update's going in a Stored
Procedure when I can get it to work...):
SELECT Customers.CustI D, Customers.CustD isplayName,
Customers.CustF irstName, Customers.CustS urname, Customers.CustT ype,
Customers.CustN otes, Customers.CustI sBillingSame,
Customers.CustN umEmployees, Customers.CustI sProspect,
Customers.CustO nHold, Customers.CustP ersonID,
Customers.CustU serFieldB1, Customers.CustU serFieldB2,
Customers.CustU serFieldB3, Customers.CustU serFieldD1,
Customers.CustU serFieldD2, Customers.CustU serFieldD3,
Customers.CustU serFieldI1, Customers.CustU serFieldI2,
Customers.CustU serFieldI3, Customers.CustC ategory,
Customers.CustI nactive, CustomerContact Details_1.CustC ontactStreet1,
CustomerContact Details_1.CustC ontactStreet2,
CustomerContact Details_1.CustC ontactStreet3,
CustomerContact Details_1.CustC ontactTown,
CustomerContact Details_1.CustC ontactCounty,
CustomerContact Details_1.CustC ontactPostCode,
CustomerContact Details_1.CustC ontactCountry,
CustomerContact Details_1.CustC ontactTelephone ,
CustomerContact Details_1.CustC ontactMobile,
CustomerContact Details_1.CustC ontactEMail,
CustomerContact Details_1.CustC ontactFax,
CustomerContact Details.CustCon tactStreet1 AS CustBContactStr eet1,
CustomerContact Details.CustCon tactStreet2 AS CustBContactStr eet2,
CustomerContact Details.CustCon tactStreet3 AS CustBContactStr eet3,
CustomerContact Details.CustCon tactTown AS CustBContactTow n,
CustomerContact Details.CustCon tactCounty AS CustBContactCou nty,
CustomerContact Details.CustCon tactPostCode AS CustBContactPos tCode,
CustomerContact Details.CustCon tactCountry AS CustBContactCou ntry,
CustomerContact Details.CustCon tactTelephone AS CustBContactTel ephone,
CustomerContact Details.CustCon tactMobile AS CustBContactMob ile,
CustomerContact Details.CustCon tactEMail AS CustBContactEMa il,
CustomerContact Details.CustCon tactFax AS CustBContactFax FROM Customers
LEFT OUTER JOIN CustomerContact Details AS CustomerContact Details_1 ON
Customers.CustA ddressID = CustomerContact Details_1.CustC ontactID LEFT
OUTER JOIN CustomerContact Details ON Customers.CustB illingID =
CustomerContact Details.CustCon tactID WHERE (Customers.Cust ID = @CustID)
<asp:SqlDataSou rce ID="SqlDataSour ce2" runat="server"
ConflictDetecti on="CompareAllV alues"
ConnectionStrin g="<%$
ConnectionStrin gs:FocusSystems ConnectionStrin g %>"
OldValuesParame terFormatString ="original_{ 0}"
ProviderName="< %$
ConnectionStrin gs:FocusSystems ConnectionStrin g.ProviderName %>"
SelectCommand=" SelectCustomers AndAddresses"
SelectCommandTy pe="StoredProce dure"
UpdateCommand=" UPDATE [Customers] SET
[CustDisplayName] = @CustDisplayNam e, [CustFirstName] = @CustFirstName,
[CustSurname] = @CustSurname, [CustType] = @CustType, [CustNotes] =
@CustNotes, [CustIsBillingSa me] = @CustIsBillingS ame,
[CustNumEmployee s] = @CustNumEmploye es, [CustIsProspect] =
@CustIsProspect , [CustOnHold] = @CustOnHold, [CustPersonID] =
@CustPersonID, [CustUserFieldB1] = @CustUserFieldB 1, [CustUserFieldB2]
= @CustUserFieldB 2, [CustUserFieldB3] = @CustUserFieldB 3,
[CustUserFieldD1] = @CustUserFieldD 1, [CustUserFieldD2] =
@CustUserFieldD 2, [CustUserFieldD3] = @CustUserFieldD 3,
[CustUserFieldI1] = @CustUserFieldI 1, [CustUserFieldI2] =
@CustUserFieldI 2, [CustUserFieldI3] = @CustUserFieldI 3, [CustCategory]
= @CustCategory, [CustInactive] = @CustInactive WHERE [CustID] =
@original_CustI D AND [CustDisplayName] = @original_CustD isplayName AND
[CustFirstName] = @original_CustF irstName AND [CustSurname] =
@original_CustS urname AND [CustType] = @original_CustT ype AND
[CustIsBillingSa me] = @original_CustI sBillingSame AND
[CustNumEmployee s] = @original_CustN umEmployees AND [CustIsProspect] =
@original_CustI sProspect AND [CustOnHold] = @original_CustO nHold AND
[CustPersonID] = @original_CustP ersonID AND [CustCategory] =
@original_CustC ategory AND [CustInactive] = @original_CustI nactive"
EnableViewState ="true">
<UpdateParamete rs>
<asp:Paramete r Name="CustDispl ayName"
Type="String" />
<asp:Paramete r Name="CustFirst Name"
Type="String" />
<asp:Paramete r Name="CustSurna me" Type="String"
/>
<asp:Paramete r Name="CustType" Type="String" />
<asp:Paramete r Name="CustNotes " Type="String"
/>
<asp:Paramete r Name="CustIsBil lingSame"
Type="Boolean" />
<asp:Paramete r Name="CustNumEm ployees"
Type="Int32" />
<asp:Paramete r Name="CustIsPro spect"
Type="Boolean" />
<asp:Paramete r Name="CustOnHol d" Type="Boolean"
/>
<asp:Paramete r Name="CustPerso nID" />
<asp:Paramete r Name="CustUserF ieldB1"
Type="String" />
<asp:Paramete r Name="CustUserF ieldB2"
Type="String" />
<asp:Paramete r Name="CustUserF ieldB3"
Type="String" />
<asp:Paramete r Name="CustUserF ieldD1"
Type="String" />
<asp:Paramete r Name="CustUserF ieldD2"
Type="String" />
<asp:Paramete r Name="CustUserF ieldD3"
Type="String" />
<asp:Paramete r Name="CustUserF ieldI1"
Type="String" />
<asp:Paramete r Name="CustUserF ieldI2"
Type="String" />
<asp:Paramete r Name="CustUserF ieldI3"
Type="String" />
<asp:Paramete r Name="CustCateg ory"
Type="String" />
<asp:Paramete r Name="CustInact ive"
Type="Boolean" />
<asp:Paramete r Name="original_ CustID" />
<asp:Paramete r Name="original_ CustDisplayName "
/>
<asp:Paramete r Name="original_ CustFirstName" />
<asp:Paramete r Name="original_ CustSurname" />
<asp:Paramete r Name="original_ CustType" />
<asp:Paramete r Name="original_ CustNotes" />
<asp:Paramete r
Name="original_ CustIsBillingSa me" />
<asp:Paramete r Name="original_ CustNumEmployee s"
/>
<asp:Paramete r Name="original_ CustIsProspect"
/>
<asp:Paramete r Name="original_ CustOnHold" />
<asp:Paramete r Name="original_ CustPersonID" />
<asp:Paramete r Name="original_ CustUserFieldB1 "
/>
<asp:Paramete r Name="original_ CustUserFieldB2 "
/>
<asp:Paramete r Name="original_ CustUserFieldB3 "
/>
<asp:Paramete r Name="original_ CustUserFieldD1 "
/>
<asp:Paramete r Name="original_ CustUserFieldD2 "
/>
<asp:Paramete r Name="original_ CustUserFieldD3 "
/>
<asp:Paramete r Name="original_ CustUserFieldI1 "
/>
<asp:Paramete r Name="original_ CustUserFieldI2 "
/>
<asp:Paramete r Name="original_ CustUserFieldI3 "
/>
<asp:Paramete r Name="original_ CustCategory" />
<asp:Paramete r Name="original_ CustInactive" />
<asp:Paramete r Name="CustConta ctStreet1"
Type="String" />
<asp:Paramete r Name="CustConta ctStreet2"
Type="String" />
<asp:Paramete r Name="CustConta ctStreet3"
Type="String" />
<asp:Paramete r Name="CustConta ctTown"
Type="String" />
<asp:Paramete r Name="CustConta ctCounty"
Type="String" />
<asp:Paramete r Name="CustConta ctPostCode"
Type="String" />
<asp:Paramete r Name="CustConta ctCountry"
Type="String" />
<asp:Paramete r Name="CustConta ctTelephone"
Type="String" />
<asp:Paramete r Name="CustConta ctMobile"
Type="String" />
<asp:Paramete r Name="CustConta ctEMail"
Type="String" />
<asp:Paramete r Name="CustConta ctFax"
Type="String" />
<asp:Paramete r
Name="original_ CustContactStre et1" Type="String" />
<asp:Paramete r
Name="original_ CustContactStre et2" Type="String" />
<asp:Paramete r
Name="original_ CustContactStre et3" Type="String" />
<asp:Paramete r Name="original_ CustContactTown "
Type="String" />
<asp:Paramete r
Name="original_ CustContactCoun ty" Type="String" />
<asp:Paramete r
Name="original_ CustContactPost Code" Type="String" />
<asp:Paramete r
Name="original_ CustContactCoun try" Type="String" />
<asp:Paramete r
Name="original_ CustContactTele phone" Type="String" />
<asp:Paramete r
Name="original_ CustContactMobi le" Type="String" />
<asp:Paramete r Name="original_ CustContactEMai l"
Type="String" />
<asp:Paramete r Name="original_ CustContactFax"
Type="String" />
<asp:Paramete r Name="CustBCont actStreet1"
Type="String" />
<asp:Paramete r Name="CustBCont actStreet2"
Type="String" />
<asp:Paramete r Name="CustBCont actStreet3"
Type="String" />
<asp:Paramete r Name="CustBCont actTown"
Type="String" />
<asp:Paramete r Name="CustBCont actCounty"
Type="String" />
<asp:Paramete r Name="CustBCont actPostCode"
Type="String" />
<asp:Paramete r Name="CustBCont actCountry"
Type="String" />
<asp:Paramete r Name="CustBCont actTelephone"
Type="String" />
<asp:Paramete r Name="CustBCont actMobile"
Type="String" />
<asp:Paramete r Name="CustBCont actEMail"
Type="String" />
<asp:Paramete r Name="CustBCont actFax"
Type="String" />
<asp:Paramete r
Name="original_ CustBContactStr eet1" Type="String" />
<asp:Paramete r
Name="original_ CustBContactStr eet2" Type="String" />
<asp:Paramete r
Name="original_ CustBContactStr eet3" Type="String" />
<asp:Paramete r Name="original_ CustBContactTow n"
Type="String" />
<asp:Paramete r
Name="original_ CustBContactCou nty" Type="String" />
<asp:Paramete r
Name="original_ CustBContactPos tCode" Type="String" />
<asp:Paramete r
Name="original_ CustBContactCou ntry" Type="String" />
<asp:Paramete r
Name="original_ CustBContactTel ephone" Type="String" />
<asp:Paramete r
Name="original_ CustBContactMob ile" Type="String" />
<asp:Paramete r
Name="original_ CustBContactEMa il" Type="String" />
<asp:Paramete r Name="original_ CustBContactFax "
Type="String" />
</UpdateParameter s>
<SelectParamete rs>
<asp:ControlPar ameter
ControlID="Cust NameSelect" Name="CustID" PropertyName="S electedValue"
/>
</SelectParameter s>
</asp:SqlDataSour ce>
</td>
</tr>
<tr><td>
<asp:DetailsVie w ID="DetailsView 1" runat="server"
AutoGenerateRow s="False" DataSourceID="S qlDataSource2"
Height="50px" Width="125px" DataKeyNames="C ustID">
<Fields>
<asp:BoundFie ld DataField="Cust ID"
HeaderText="Cus tID" ReadOnly="True" SortExpression= "CustID" />
<asp:BoundFie ld DataField="Cust DisplayName"
HeaderText="Cus tDisplayName" SortExpression= "CustDisplayNam e" />
<asp:BoundFie ld DataField="Cust FirstName"
HeaderText="Cus tFirstName" SortExpression= "CustFirstN ame" />
<asp:BoundFie ld DataField="Cust Surname"
HeaderText="Cus tSurname" SortExpression= "CustSurnam e" />
<asp:BoundFie ld DataField="Cust Type"
HeaderText="Cus tType" SortExpression= "CustType" />
<asp:BoundFie ld DataField="Cust Notes"
HeaderText="Cus tNotes" SortExpression= "CustNotes" />
<asp:CheckBoxFi eld DataField="Cust IsBillingSame"
HeaderText="Cus tIsBillingSame" SortExpression= "CustIsBillingS ame" />
<asp:BoundFie ld DataField="Cust NumEmployees"
HeaderText="Cus tNumEmployees" SortExpression= "CustNumEmploye es" />
<asp:CheckBoxFi eld DataField="Cust IsProspect"
HeaderText="Cus tIsProspect" SortExpression= "CustIsProspect " />
<asp:CheckBoxFi eld DataField="Cust OnHold"
HeaderText="Cus tOnHold" SortExpression= "CustOnHold " />
<asp:BoundFie ld DataField="Cust PersonID"
HeaderText="Cus tPersonID" SortExpression= "CustPerson ID" />
<asp:BoundFie ld DataField="Cust UserFieldB1"
HeaderText="Cus tUserFieldB1" SortExpression= "CustUserFieldB 1" />
<asp:BoundFie ld DataField="Cust UserFieldB2"
HeaderText="Cus tUserFieldB2" SortExpression= "CustUserFieldB 2" />
<asp:BoundFie ld DataField="Cust UserFieldB3"
HeaderText="Cus tUserFieldB3" SortExpression= "CustUserFieldB 3" />
<asp:BoundFie ld DataField="Cust UserFieldD1"
HeaderText="Cus tUserFieldD1" SortExpression= "CustUserFieldD 1" />
<asp:BoundFie ld DataField="Cust UserFieldD2"
HeaderText="Cus tUserFieldD2" SortExpression= "CustUserFieldD 2" />
<asp:BoundFie ld DataField="Cust UserFieldD3"
HeaderText="Cus tUserFieldD3" SortExpression= "CustUserFieldD 3" />
<asp:BoundFie ld DataField="Cust UserFieldI1"
HeaderText="Cus tUserFieldI1" SortExpression= "CustUserFieldI 1" />
<asp:BoundFie ld DataField="Cust UserFieldI2"
HeaderText="Cus tUserFieldI2" SortExpression= "CustUserFieldI 2" />
<asp:BoundFie ld DataField="Cust UserFieldI3"
HeaderText="Cus tUserFieldI3" SortExpression= "CustUserFieldI 3" />
<asp:BoundFie ld DataField="Cust Category"
HeaderText="Cus tCategory" SortExpression= "CustCatego ry" />
<asp:CheckBoxFi eld DataField="Cust Inactive"
HeaderText="Cus tInactive" SortExpression= "CustInacti ve" />
<asp:BoundFie ld DataField="Cust ContactStreet1"
HeaderText="Cus tContactStreet1 " SortExpression= "CustContactStr eet1" />
<asp:BoundFie ld DataField="Cust ContactStreet2"
HeaderText="Cus tContactStreet2 " SortExpression= "CustContactStr eet2" />
<asp:BoundFie ld DataField="Cust ContactStreet3"
HeaderText="Cus tContactStreet3 " SortExpression= "CustContactStr eet3" />
<asp:BoundFie ld DataField="Cust ContactTown"
HeaderText="Cus tContactTown" SortExpression= "CustContactTow n" />
<asp:BoundFie ld DataField="Cust ContactCounty"
HeaderText="Cus tContactCounty" SortExpression= "CustContactCou nty" />
<asp:BoundFie ld DataField="Cust ContactPostCode "
HeaderText="Cus tContactPostCod e"
SortExpression= "CustContactPos tCode" />
<asp:BoundFie ld DataField="Cust ContactCountry"
HeaderText="Cus tContactCountry " SortExpression= "CustContactCou ntry" />
<asp:BoundFie ld DataField="Cust ContactTelephon e"
HeaderText="Cus tContactTelepho ne"
SortExpression= "CustContactTel ephone" />
<asp:BoundFie ld DataField="Cust ContactMobile"
HeaderText="Cu stContactMobile " SortExpression= "CustContactMob ile" />
<asp:BoundFie ld DataField="Cust ContactEMail"
HeaderText="Cus tContactEMail" SortExpression= "CustContactEMa il" />
<asp:BoundFie ld DataField="Cust ContactFax"
HeaderText="Cus tContactFax" SortExpression= "CustContactFax " />
<asp:BoundFie ld DataField="Cust BContactStreet1 "
HeaderText="Cus tBContactStreet 1"
SortExpression= "CustBContactSt reet1" />
<asp:BoundFie ld DataField="Cust BContactStreet2 "
HeaderText="Cus tBContactStreet 2"
SortExpression= "CustBContactSt reet2" />
<asp:BoundFie ld DataField="Cust BContactStreet3 "
HeaderText="Cus tBContactStreet 3"
SortExpression= "CustBContactSt reet3" />
<asp:BoundFie ld DataField="Cust BContactTown"
HeaderText="Cus tBContactTown" SortExpression= "CustBContactTo wn" />
<asp:BoundFie ld DataField="Cust BContactCounty"
HeaderText="Cus tBContactCounty " SortExpression= "CustBContactCo unty" />
<asp:BoundFie ld DataField="Cust BContactPostCod e"
HeaderText="Cus tBContactPostCo de"
SortExpression= "CustBContactPo stCode" />
<asp:BoundFie ld DataField="Cust BContactCountry "
HeaderText="Cus tBContactCountr y"
SortExpression= "CustBContactCo untry" />
<asp:BoundFie ld DataField="Cust BContactTelepho ne"
HeaderText="Cus tBContactTeleph one"
SortExpression= "CustBContactTe lephone" />
<asp:BoundFie ld DataField="Cust BContactMobile"
HeaderText="Cus tBContactMobile " SortExpression= "CustBContactMo bile" />
<asp:BoundFie ld DataField="Cust BContactEMail"
HeaderText="Cus tBContactEMail" SortExpression= "CustBContactEM ail" />
<asp:BoundFie ld DataField="Cust BContactFax"
HeaderText="Cus tBContactFax" SortExpression= "CustBContactFa x" />
<asp:CommandFie ld ShowEditButton= "True" />
</Fields>
</asp:DetailsView >

Jan 30 '06 #2
It's just not updating. I'm going to try a timestamp concurrency
approach instead (came to me at 4AM this morning), unless anyone can
better advise!

Thanks,

Stuart

Jan 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5029
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my select, remember it, and then use it in the update. It works just fine when I have full control of the whole process. I want to do the same for my GridView/SqlDataSource combinations. I typically select from a view and update the corresponding...
2
2190
by: John | last post by:
In 'Data Adapter Configuration Wizard' for OleDbDataAdapter, there's a checkbox called 'Use optimistic concurrency' that allows to turn on/off the option. I don't use the wizard, I create MyDataAdapter using the following, MyDataAdapter = new New OleDbDataAdapter(MySql, MyDatabase) The question is how to turn off the 'Use optimistic concurrency' option in my case. Thanks.
9
2209
by: Dan Sikorsky | last post by:
When I hit the Test Query button in the SqlDataSource design, all the rows come back. But when I run the website, without any changes, in the IDE, the GridView tied to the SqlDataSoure is empty. How do I get this working? -- Thank you kindly, Dan Sikorsky BA, BSCE, MCS
0
1562
by: russganz | last post by:
It seems to me there are real problems with the datagridview (along with the detailsview and form view) control when using optimistic concurrency with fields that can be null. Trying to use these controls I have many times had the update not work with no error generated. After much experimentation I have narrowed it down to how the Update Command is generated. To make optimistic currency work, the builder generated an update statement...
0
1504
by: ASMJ | last post by:
Hi, I have a web page where I use a sqldatasource to manipulate data in a gridview. I am using all the sqlstatements generated by the sqldatasource and I have not hand written any code. The problem is that the Gridview does not update any rows having null values. This is because the option of "Use Optimistic Concurrency" is checked while configuring the SqlDataSource. This seems to be a bug as given in ...
1
1191
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I was suddenly told to whip up a web project in ASP.Net 2.0. The last few weeks have been a crash course in new technology. I've done some 1.1 web work but it's been a while. The basics are really quite simple and I want to keep it that way. I'm using virtually nothing but grid views and detailsviews. The grids are used solely for display. Each row has an edit hyperlink that goes to a detailsview for actual edits and inserts. The...
1
2048
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
(If I'm overlooking anything, please let me know.) First, my only concern is updating single records in a Detailsview using an ObjectDataSource. The target table has a timestamp field. Assume a single primary key. Create your xsd. Drag the table onto the xsd. Then manually edit the Update statement to simplify it. Essentially 'Update <tableset blah = blah Where (PK=@PK) and (ts=@ts)'. (Get rid of all that auto-generated...
8
3969
by: Roger.Noreply | last post by:
Hi, Sql-Server 2000, 2005. A report fetches a lot of rows using the "WITH (ROWLOCK)" syntax (the sql is generated on the fly by a tool and not easily changeable). SELECT col1, col2 FROM mytab WITH (ROWLOCK) WHERE ...." The select-clause runs for several minutes. Another user fetches one of those rows and tries to update it. The result is a lock timeout.
1
1391
by: ken | last post by:
Hi All, I try to using the dotnet control instead of code behind to create a quick solution (ASP.NET with VB.NET) by using the SqlDataSource and GridView control (with SelectCommand, DeleteCommand, UpdateCommand, InsertCommand) It works fine when drag and drop in the first time. but after I have modify something (said, add parmeters for searching...etc), the UpdateCommand and
0
8620
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8571
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7047
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5537
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4048
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4115
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2560
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1705
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1420
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.