Thanks Ryan,
Ok, that wasn't the problem. I had that specified in the GridView
already. The problem was my function UpdateAllergy, this is what it
should be:
Public Function UpdateAllergy(ByVal a As Allergy) As Integer
Return AllergiesDB.UpdateAllergy(a.AllergyID, a.daycareCode,
a.AllergyEn, a.AllergyFr)
End Function
And what I had was "ByRef a As Allergy". Sheesh....for crying out
loud....I can't believe it. I didn't even notice that I changed it
for use in another area. I just wish it would have been easier to
trace the problem, like an error message that made a little more
sense.
--- In StrongTypes@yahoogroups.com, "Ryan Olshan" <teranetlists@...>
wrote:
>
> Hi Dave,
>
> This most likely has to do with the primary key. Make sure that
the primary
> key is included in the DataKeyNames property for the GridView.
>
> HTH
>
> Thank you,
> Ryan Olshan
> Website - http://www.StrongTypes.com
<http://www.strongtypes.com/>
> Group - http://groups.yahoo.com/group/StrongTypes
> Blog - http://blogs.dirteam.com/blogs/ryan/
>
>
> _____
>
> From: StrongTypes@yahoogroups.com
[mailto:StrongTypes@yahoogroups.com] On
> Behalf Of preludeandave
> Sent: Wednesday, February 15, 2006 10:18 PM
> To: StrongTypes@yahoogroups.com
> Subject: [StrongTypes] Generics: ObjectDataSource, GridView, and
BLL
>
>
> Hi everyone,
>
> I love the idea of generics and am trying to put it to use,
> following the samples given on www.asp.net tutorials,
specifically:
> http://www.asp.net/QuickStart/util/srcview.aspx?
>
path=~/aspnet/samples/data/GridViewObject.src&file=GridViewObject_vb\
> GridViewObject_vb.aspx&lang=VB+Source
>
> I've set up my GridView to access the ObjectDataSource, and my ODS
> is set up as:
> <asp:ObjectDataSource ID="AllergyODS" Runat="server"
> TypeName="AllergiesComponent"
>
> SelectMethod="GetAllergies" UpdateMethod="UpdateAllergy"
> DataObjectTypeName="Allergy" SortParameterName="SortExpression">
>
> </asp:ObjectDataSource>
>
> However, whenever I hit Update, I get the dreaded:
> ObjectDataSource 'AllergyODS' could not find a non-generic
> method 'UpdateAllergy' that takes parameters of type 'Allergy'.
>
> Does anybody have a clue:
> a) why this doesn't work as per the examples supplied on asp.net?
> b) how I can find the signature of the function that it is trying
to
> call?
>
> Thanks,
> Dave
>
>
>
>
>
>
>
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "StrongTypes
> <http://groups.yahoo.com/group/StrongTypes> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> StrongTypes-unsubscribe@yahoogroups.com
> <mailto:StrongTypes-unsubscribe@yahoogroups.com?
subject=Unsubscribe>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
>
>
>
> [Non-text portions of this message have been removed]
>