hi
asp.net 2.0
I'm having problem updating a GridView. The problems is that the website
complains it don't find the update method. The problem is caused by the
updateparameter s. The UpdateMethod take 3 parameters: Id (DataKeyNames),
Kode and Desc.
Here is the markup of both GridView and ObjectDataSourc e:
<asp:GridView ID="gvwPhoneTyp e"
runat="server" OnRowUpdating=" gvwPhoneType_Ro wUpdating"
OnRowDataBound= "gvwPhoneType_D ataBound"
OnRowEditing="g vwPhoneType_Row Editing"
OnRowDeleting=" gvwPhoneType_Ro wDeleting"
DataSourceID="o dsPhoneType" DataKeyNames="I d"
OnRowCancelingE dit="gvwPhoneTy pe_RowCanceling Edit"
AutoGenerateEdi tButton="true"
ShowFooter="tru e"
AutoGenerateCol umns="false" >
//columns go here
<asp:ObjectData Source ID="odsPhoneTyp e"
TypeName="DAL.S qlServer2005.Sq lSupportProvide r"
SelectMethod="g etPhoneTypes" UpdateMethod="u pdatePhoneType"
InsertMethod="i nsertPhoneType" runat="server">
<UpdateParamete rs>
<asp:Paramete r Type="Char" Name="type" Direction="Inpu t" />
<asp:Paramete r Type="string" Name="desc" Direction="Inpu t" />
</UpdateParameter s>
<InsertParamete rs>
<asp:Paramete r Type="Char" Name="Type" />
<asp:Paramete r Type="string" Name="Desc" />
</InsertParameter s>
</asp:ObjectDataS ource>
UpdateMethod:
public override void updatePhoneType (int id, char type, string desc)
So I thought about manually calling the UpdateMethod from the OnRowUpdating
event. Possible? any suggestions?
asp.net 2.0
I'm having problem updating a GridView. The problems is that the website
complains it don't find the update method. The problem is caused by the
updateparameter s. The UpdateMethod take 3 parameters: Id (DataKeyNames),
Kode and Desc.
Here is the markup of both GridView and ObjectDataSourc e:
<asp:GridView ID="gvwPhoneTyp e"
runat="server" OnRowUpdating=" gvwPhoneType_Ro wUpdating"
OnRowDataBound= "gvwPhoneType_D ataBound"
OnRowEditing="g vwPhoneType_Row Editing"
OnRowDeleting=" gvwPhoneType_Ro wDeleting"
DataSourceID="o dsPhoneType" DataKeyNames="I d"
OnRowCancelingE dit="gvwPhoneTy pe_RowCanceling Edit"
AutoGenerateEdi tButton="true"
ShowFooter="tru e"
AutoGenerateCol umns="false" >
//columns go here
<asp:ObjectData Source ID="odsPhoneTyp e"
TypeName="DAL.S qlServer2005.Sq lSupportProvide r"
SelectMethod="g etPhoneTypes" UpdateMethod="u pdatePhoneType"
InsertMethod="i nsertPhoneType" runat="server">
<UpdateParamete rs>
<asp:Paramete r Type="Char" Name="type" Direction="Inpu t" />
<asp:Paramete r Type="string" Name="desc" Direction="Inpu t" />
</UpdateParameter s>
<InsertParamete rs>
<asp:Paramete r Type="Char" Name="Type" />
<asp:Paramete r Type="string" Name="Desc" />
</InsertParameter s>
</asp:ObjectDataS ource>
UpdateMethod:
public override void updatePhoneType (int id, char type, string desc)
So I thought about manually calling the UpdateMethod from the OnRowUpdating
event. Possible? any suggestions?