Error on inserting record from footer of a GridView:

Joined
Dec 12, 2009
Messages
1
Reaction score
0
I was trying to get inserting a new record working from a GridView:
as per the example from
www().asp.net/LEARN/data-access/tutorial-53-vb.aspx
ProductsDataSource.Insert() -- in Protected Sub Products_RowCommand
I have my own
<My>DataSource.Insert()
This method call that is getting the error.

The Insert method returns an Int, some how the validation is causing it to return a boolean? totally baffling me.

Any help is appreciated:

Error is below:

System.ArgumentException was unhandled by user code
Message="Object of type 'System.Boolean' cannot be converted to type 'System.Int32'."
Source="mscorlib"
StackTrace:
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance)
at System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method)
at System.Web.UI.WebControls.ObjectDataSourceView.ExecuteInsert(IDictionary values)
at System.Web.UI.WebControls.ObjectDataSource.Insert()
at _Default.Milestones_Activity_RowCommand(Object sender, GridViewCommandEventArgs e) in d:\data\mmahal\My Documents\Visual Studio 2008\WebSites\erisk\Default6.aspx.vb:line 12
at System.Web.UI.WebControls.GridView.OnRowCommand(GridViewCommandEventArgs e)
at System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup)
at System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top