G
Guest
I have a FormView tied to ObjectDataSource that's not updating and am
wondering what I missed..
<asp:FormView ID="fvRegDetail" runat="server" DefaultMode="Edit"
DataKeyNames="RegistrantId" DataSourceID="odsRegistrant"
CssClass="waFormView" >
<EditItemTemplate>
....
<asp:Button ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" ValidationGroup="regForm">
</asp:Button>
<asp:ObjectDataSource ID="odsRegistrant" runat="server"
TypeName="RegistrantDB" SelectMethod="GetRegistrant"
UpdateMethod="UpdateRegistrant" DataObjectTypeName="RegistrantDetails"
ConvertNullToDBNull="true">
<SelectParameters>
<asp:SessionParameter DefaultValue="60" Name="registrantId"
SessionField="RegistrantId"
Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asparameter Name="firstName" Type="String" />
<asparameter Name="mI" Type="String" />
<asparameter Name="lastName" Type="String" />
<asparameter Name="eMail" Type="String" />
...
My TypeName has:
public void UpdateRegistrant( RegistrantDetails reg ) {
SqlConnection con = new SqlConnection( connectionString );
SqlCommand cmd = new SqlCommand( "UpdateRegistrant", con );
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add( new SqlParameter( "@FirstName", SqlDbType.NVarChar,
25 ) );
cmd.Parameters["@FirstName"].Value = reg.FirstName == null ? "" :
reg.FirstName;
....
And my DataObjectTypeName has:
public RegistrantDetails(){}
protected string firstName = String.Empty;
public string FirstName
{
get {return firstName;}
set {if (value != null){firstName = value;}}
}
....
Thanks for any clues as to what I must have missed. No exceptions are
generated and debugger shows the set and update methods aren't invoked.
Thanks much.
wondering what I missed..
<asp:FormView ID="fvRegDetail" runat="server" DefaultMode="Edit"
DataKeyNames="RegistrantId" DataSourceID="odsRegistrant"
CssClass="waFormView" >
<EditItemTemplate>
....
<asp:Button ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" ValidationGroup="regForm">
</asp:Button>
<asp:ObjectDataSource ID="odsRegistrant" runat="server"
TypeName="RegistrantDB" SelectMethod="GetRegistrant"
UpdateMethod="UpdateRegistrant" DataObjectTypeName="RegistrantDetails"
ConvertNullToDBNull="true">
<SelectParameters>
<asp:SessionParameter DefaultValue="60" Name="registrantId"
SessionField="RegistrantId"
Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asparameter Name="firstName" Type="String" />
<asparameter Name="mI" Type="String" />
<asparameter Name="lastName" Type="String" />
<asparameter Name="eMail" Type="String" />
...
My TypeName has:
public void UpdateRegistrant( RegistrantDetails reg ) {
SqlConnection con = new SqlConnection( connectionString );
SqlCommand cmd = new SqlCommand( "UpdateRegistrant", con );
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add( new SqlParameter( "@FirstName", SqlDbType.NVarChar,
25 ) );
cmd.Parameters["@FirstName"].Value = reg.FirstName == null ? "" :
reg.FirstName;
....
And my DataObjectTypeName has:
public RegistrantDetails(){}
protected string firstName = String.Empty;
public string FirstName
{
get {return firstName;}
set {if (value != null){firstName = value;}}
}
....
Thanks for any clues as to what I must have missed. No exceptions are
generated and debugger shows the set and update methods aren't invoked.
Thanks much.