473,698 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ObjectDataSourc e 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 ObjectDatasourc e
to the Dataset type from my other project. I assigned the Insert, Update, and
select to the ObjectDataSourc e. I attached the gridview control to the
ObjectDataSourc e. 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.Nullabl e`1[System.Int32]&'.

[ArgumentExcepti on: Object of type 'System.Int16' cannot be converted to
type 'System.Nullabl e`1[System.Int32]&'.]
System.RuntimeT ype.CheckValue( Object value, Binder binder, CultureInfo
culture, BindingFlags invokeAttr) +843
System.Reflecti on.MethodBase.C heckArguments(O bject[] parameters, Binder
binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig) +199
System.Reflecti on.RuntimeMetho dInfo.Invoke(Ob ject obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean
skipVisibilityC hecks) +325
System.Reflecti on.RuntimeMetho dInfo.Invoke(Ob ject obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29

System.Web.UI.W ebControls.Obje ctDataSourceVie w.InvokeMethod( ObjectDataSourc eMethod method, Boolean disposeInstance , Object& instance) +482

System.Web.UI.W ebControls.Obje ctDataSourceVie w.InvokeMethod( ObjectDataSourc eMethod method) +38
System.Web.UI.W ebControls.Obje ctDataSourceVie w.ExecuteUpdate (IDictionary
keys, IDictionary values, IDictionary oldValues) +2573
System.Web.UI.D ataSourceView.U pdate(IDictiona ry keys, IDictionary values,
IDictionary oldValues, DataSourceViewO perationCallbac k callback) +78
System.Web.UI.W ebControls.Grid View.HandleUpda te(GridViewRow row, Int32
rowIndex, Boolean causesValidatio n) +1215
System.Web.UI.W ebControls.Grid View.HandleEven t(EventArgs e, Boolean
causesValidatio n, String validationGroup ) +858
System.Web.UI.W ebControls.Grid View.OnBubbleEv ent(Object source, EventArgs
e) +95
System.Web.UI.C ontrol.RaiseBub bleEvent(Object source, EventArgs args) +35
System.Web.UI.W ebControls.Grid ViewRow.OnBubbl eEvent(Object source,
EventArgs e) +117
System.Web.UI.C ontrol.RaiseBub bleEvent(Object source, EventArgs args) +35
System.Web.UI.W ebControls.Link Button.OnComman d(CommandEventA rgs e) +115
System.Web.UI.W ebControls.Link Button.RaisePos tBackEvent(Stri ng
eventArgument) +163

System.Web.UI.W ebControls.Link Button.System.W eb.UI.IPostBack EventHandler.Ra isePostBackEven t(String eventArgument) +7
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +174
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +5102


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

Now I checked the values in the DataSource_Upda ting 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.Designe r.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 1423

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

Similar topics

1
5152
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 ObjectDataSource binding to a SQLX db using a foreign key to filter the returned result set to display in a GridView. The error message in the subject line is generated when I try to bind the following GridView to the ObjectSource that follows...
4
8500
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 reading): <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" DataKeyNames="Id" OnRowUpdated="GridView1_RowUpdated">
3
1874
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 'ObjectDataSource1' could not find a non-generic method 'UpdateProduct' that has parameters: ProductName, UnitPrice, ProductId. I have been unable to work through this. Any ideas? I’m using code pasted directly from this page:
1
4242
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 when my application is trying to insert a record from a formview. It works fine for delete, update, but insert just keeps failing. I have removed the OldValuesParameterFormatString="original_{0}" from the
0
1888
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 paging. The objectdatasource SelectMethod returns a dataview. When my objectdatasource is declared in the codebehind, sorting is not working and i receive following error when clicking on a datagrid's column header. I made the same test...
5
2648
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 simply working with objects in memory. So, it appears as though Microsoft requires that our datamapper classes reside inside a folder called "App_Code", and NO WHERE ELSE. So, has anyone successfully been able to place their datamappers in a...
1
1695
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 collections of textboxes prompting for entry into a fairly monolithic database. I decided to create a business object (called Employee) and use the ObjectDataSource to broker data being transmitted between the UI and my Employee object (and...
0
1642
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 create, retrieve, update and delete data.
0
1086
by: Sasa | last post by:
FormView is connected to ObjectDataSource Table example id Name Forname when ObjectDataSource is set ConflictDetection = OverwriteChanges
0
987
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 calling. I wrapped it into an object that have a function (GetAgentList) that return a datatable. I usually have no problem using that with SQLDataSource. May be I'm missing something with ObjectDataSource I get a weird error message (see below)....
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8862
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6521
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.