objectdatasource

Need help with asp objectdatasource

I've got a Payment class with delete, insert methods. public class Payment { public int Id { get; set; } public int UserId { get; set; } public string Fullname { get; set; } public DateTime Date { get; set; } public double Sum { get; set; } public string PaymentType { get; set; } public string RecordInfo { g...

ObjectDataSource calls update method with old values

i have an instance of ObjectDataSource with specified update method. But on update i have an old values(previously set in gridview) in method - they are not updating. <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="DeletePayment" InsertMethod="InsertPayment" SelectMethod="GetPayments" T...

objectDataSource updating - read only dictionary problem

protected void objUpdating(object sender, ObjectDataSourceMethodEventArgs e) { e.InputParameters.Add("update_name", "xxx"); } Hi, I am trying to make Update method for ObjectDataSource, which has argument "update_name" but adding parameter to collection using add method throws an exception of dictionary ( key value ) i...

Formview with objectdatasource generating invalid update params

I've a form view with various field in edit and an object datasource where I've defined my update parameters that my update method takes. I've set some of the fields in the edit template to read only because I want them to display. Unfortunately they are getting passed in as update parameters somehow to my objectdatasource. So, it is ge...

Can’t get FormView values from ObjectDataSource on update

Working with .NET 2.0, I have a FormView with fields bound to an ObjectDataSource (ODS). Those fields start out with the correct values—that is, they come from the Person object when the ODS’s SelectMethod is called—but after making changes and calling the ODS’s UpdateMethod, I can’t get these new—or any—values from the fields from anyw...

ASP.NET two way databinding with nested objects

Howdy, Recently I returned to ASP.NET WebForms programming and I've come across a problem that I'm sure was not an issue previously. I have a Customer object with and Address object, I can bind up to all the properties of the customer (including the address for display) but when the formview binds back it throws an exception say that...

Does Visual Web Part support ObjectDataSource in designer?

I'm trying to upgrade some Sharepoint 2007 webparts to SP2010 using the web part projects built into Visual Studio 2010. Namely, I'm using Visual Web Part to migrate our existing controls, which make extensive use of ObjectDataSource. However, when adding an ODS to the control in the Visual Web Part project, it will not pick up objects i...

Custom sorting object datasource binded gridview

Hi, I want to sort my gridview binded to an object datasource fetching business objects. I have already implemented custom paging & now want to implement sorting. Just read this article but there is lot of concatenation going on there with the SQL Query. Any other elegant solution guys ? http://aspnet.4guysfromrolla.com/articles/032206-...

Resolving method overload among LINQ query methods

So, the context of this question is pretty specific, but I think there is a general C# question struggling to get out. :) I have an ASP.NET Web Forms page with a GridView control bound to an ObjectDataSource. The data source control is hooked to a data access class that, in turn, uses LINQ to query Entity Framework v4. The methods on t...

GridView, ObjectDataSource, and Custom Pagination with MySQL

I am trying to hook up custom pagination with an ObjectDataSource to my GridView. However, this thing renders no data, but does render the column headers. The debugger clearly indicates a populated DataTable being returned: <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AllowPaging="True" /> <asp:ObjectDat...

ods_Selected Row Count

Hello all. I have the following bit of code that gives me the number of rows in a gridview bound to an object data source. protected void odsProduct_Selected(object sender, ObjectDataSourceStatusEventArgs e) { lblHowManyRows.Text = ((List<tblProduct>)e.ReturnValue).Count.ToString(); Lovely. However, how would I g...

Opening gridview in new window, passing parameters between pages.

Hello all. I have the following scenario I would like to implement. I have a number of drop downs that the client can select a range of criteria. From this, they will press a button, the query will be generated and low and behold, a gridview will be produced in a new window (or at least give that impression) bound by an object datasour...

Winforms. ObjectDataSource add calculated column

Hello. I use ObjectDataSource and bind IEnumerable[Person] to my DevExpress GridView class Person { private int Id {get; set;} public string Name {get; set;} } At grid there are two columns Id,Name. I want new column "Sum", which is calculated by person object(aggragate by person). At asp.net I create new column and calculate i...

How to change properties of a class in the ObjectDataSource Updating-Event when the update method accepts the business class as parameter?

I have the following situation: My business class: public class Foo { public String A {get;set;} public DateTime B {get;set;} // .. and other properties like public String Intern {get;set;} } I'm binding that Item to a DetailsView in Editmode. (I bind a List containing a single object of Foo, becuase I do recall that I can only b...

ObjectDataSource Select Question

Is it possible to get to the object that an ObjectDataSource creates when calling the select function? Not the result of the select function itself but the object that is creates from the parameter specified in TypeName. I would like to call some other functions on that same instance after Select is called. The other solution would be ...

Asp.Net GridView : Good or Bad / What datatypes to use for binding?

So, this question may be a little vague, but I have constant discussions about it: When designing an Asp.Net page, a lot of times you might just want to throw a quick and dirty GridView on the page. When you are going that route you have the various datasource options (I typically use ObjectDataSource tied to a business object) and you...

nhibernate 2.0 Efficient Data Paging DataList Control and ObjectDataSource

Hi How would I do what Scott has done in one call using nHibernate 2 ObjectDataSource http://weblogs.asp.net/scottgu/archive/2006/01/07/434787.aspx below is my Data access method public IList GetListOfUser(int rows, int pageIndex) { IList userList = null; using (ITransaction tx = _session.BeginTransaction(...

Datasource with parameter in ASPX page to move in user control

Hello, I have a page with some datasources in it. I am doing reenginering of the page itself and would like to split some parts of the page in several user controls. In my code I have an ObjectDataSource object with the following params <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="DataSetTableAdapters.Photos...

Dynamically add columns to Gridview using different datasource than what is bound

Tell me if this is even possible: I have a gridview bound to an ObjectDataSource providing me with data from a database. I'm filling the Objectdatasource using Linq-to-entities. Typical setup where I'm supplying the columns and rows. Below I have a horrible graphical representation. x_col x_col x_col x_row| x_data ...

ASP.NET - FormView - Datasource update only some of the fields

I have a ASP.NET page that contains a formview and ObjectDataSource. On the page I only have 4 fields that are bound to fields in my datasource. My datasource contains 10 fields. When I call an update it is setting the 6 fields I am not binding to to null. The only way I can find it get around this is to add hidden fields for the 6 u...