473,321 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

ObjectDataSource Error

I created a Dataset Type on one project which generates a DLL. I have a web
project . I created a webpage with a gridview. I attached an ObjectDatasource
to the Dataset type from my other project. I assigned the Insert, Update, and
select to the ObjectDataSource. I attached the gridview control to the
ObjectDataSource. I run it and edit a record in the grid. When I hit the
update, I get the following error:

-------------------------------------------------------------------------------
Object of type 'System.Int16' cannot be converted to type
'System.Nullable`1[System.Int32]&'.

[ArgumentException: Object of type 'System.Int16' cannot be converted to
type 'System.Nullable`1[System.Int32]&'.]
System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo
culture, BindingFlags invokeAttr) +843
System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder
binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig) +199
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean
skipVisibilityChecks) +325
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29

System.Web.UI.WebControls.ObjectDataSourceView.Inv okeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +482

System.Web.UI.WebControls.ObjectDataSourceView.Inv okeMethod(ObjectDataSourceMethod method) +38
System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteUpdate(IDictionary
keys, IDictionary values, IDictionary oldValues) +2573
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values,
IDictionary oldValues, DataSourceViewOperationCallback callback) +78
System.Web.UI.WebControls.GridView.HandleUpdate(Gr idViewRow row, Int32
rowIndex, Boolean causesValidation) +1215
System.Web.UI.WebControls.GridView.HandleEvent(Eve ntArgs e, Boolean
causesValidation, String validationGroup) +858
System.Web.UI.WebControls.GridView.OnBubbleEvent(O bject source, EventArgs
e) +95
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.GridViewRow.OnBubbleEven t(Object source,
EventArgs e) +117
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.LinkButton.OnCommand(Com mandEventArgs e) +115
System.Web.UI.WebControls.LinkButton.RaisePostBack Event(String
eventArgument) +163

System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +174
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


--------------------------------------------------------------------------------

Now I checked the values in the DataSource_Updating event and the fields for
update are of the correct format. What is wrong here?

Also how can I debug my DataSetType Classes. I placed a breakpoint to the
Update Method of the Dataset.Designer.vb class file, but it never breaks. The
project is referenced in the Web Project. The Dataset Type DLL is also
compiled for DEBUG. So why is it not breaking?
Sep 22 '06 #1
0 1405

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

Similar topics

1
by: Dotnet Gruven | last post by:
I've posted this in the adonet group, however it was suggested I might have better luck here.... ============================================================= I'm trying to use a typed dataset and...
4
by: Anne Catterick | last post by:
Hi, I have an british ASP.Net 2.0 application which is doing what (should) be very simple. But I am having issues. On my page I have a GridView as follows (some tags excluded for easy...
3
by: mthomason | last post by:
I keep getting this error when trying to update records using an ObjectDataSource. I have seen others post similar errors...but I haven't found any solutions. ObjectDataSource...
1
by: tparks69 | last post by:
I get the error: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Insert' that has parameters: last_name, first_name, email, role_id, user_id, modified_by, modified_date...
0
by: Northern | last post by:
Hello, I have some trouble to declare and instantiate dynamically an ObjectDataSource in the codebehind file. The idea is to bind the objectdatasource to a gridview and have automate sorting and...
5
by: Randy Smith | last post by:
Hi ALL, I wonder if anyone has been using n-tier to bind to a GridView control by using the ObjectDataSource. This is our first OOP web application, and we have no tables. Right now we are...
1
by: =?Utf-8?B?cm9zczYxMw==?= | last post by:
I really hope this is not a case of "this silly thing will never work".....lots of time invested in troubleshooting this already. I have created a standard ASP.NET web form (.aspx) with several...
0
by: =?Utf-8?B?RGVuaXMgU29oZXQ=?= | last post by:
Hi all, I've created a new project to test ObjectDataSource component. I've just added a new objectdatasource, configured it (linked to a table) etc ... It works fine on localhost, i can...
0
by: Sasa | last post by:
FormView is connected to ObjectDataSource Table example id Name Forname when ObjectDataSource is set ConflictDetection = OverwriteChanges
0
by: sugarnet | last post by:
Hi, I have a detailsview that contains templated fields. In the Edit/Insert mode, I would like to populate my DropDown from an ObjectDataSource. The data I need comes from a webservice that I'm...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.