objectdatasource

How to configure an ObjectDataSource to select rows from a ListView

I am using Asp.net 3.5, C#, Visual Studio 2008. Ok, so I admit I am being really lazy here, but I know there's got to be a way to do this. I have 2 identical listviews - listview1 and listview2. There is a checkbox in column 1 of both listviews, and a button on the page. I would like to copy the rows that are checked in listview1 to l...

ASP.NET [Object data source]

I send id of my class object from one page to second this way NavigateUrl='<%# "ItemDetail.aspx?itemId=" + (string)Eval("Id") %>' Then I get the object with ObjectDataSource and function this way <asp:ObjectDataSource ID="ObjectDataSourceItem" runat="server" SelectMethod="GetItem" TypeName="Catalog"> <SelectPa...

Update Method Not Firing DetailsView Object Data Source

Hi, I am trying to write an asp.net page that uses a details view to display customer details and allows customers to update those details by editing the various fields and clicking update. The problem I am having is that when I click update the select method is being called and not the update method. I have a class where the update an...

ConvertEmptyStringToNull=”false” and yet the conversion still happens

hi DetailsView is bound to ObjectDataSource. Inside Detailsview’s EditItemTemplate are two TextBoxes ( T1 and T2 ). T1 is mapped to update parameter of type String, while T2 is mapped to update parameter of type DateTime. Assuming both TextBoxes contain an empty string, then when I try to update the data source by clicking on Details...

ObjectDataSource not calling Insert method when it has extra parameters

Hey folks, I'm new to ASP.NET, and I'm trying to implement a custom ObjectDataSource Insert method. The default business method works fine (with a single object parameter). However when I add an extra parameter, the business method does not get called. Here is my code - Insert() always gets called, but InsertWithParams() never does. /...

ObjectDataSource with Composite Lists

I have one list that contains Student informations lsStudents = context.GetTable<Student>().Where(p => p.M_Id.Equals(1)).ToList(); And I have another one that contains Student Lessons lsMarks = context.GetTable<Mark>().Where(p => p.M_StudentId.Equals(1)).ToList(); I want to merge these lists to one ObjectDataSource to bind to a rep...

Use selection property instead of 'SelectMethod' on ObjectDataSource?

I'm using multiple ObjectDataSources to fill ComboBox-fields in a FormView. The FormView is sort of generic, because it's appearance is different depending on it's category. The category is defined in the url of the webpage. I'd like to create a class that filters the category out and expose several properties, that can be used to fill ...

How to access ObjectDataSource object after bind to GridView

I have a GridView, I bind it to ObjectDataSource. ObjectDataSource takes data from a database's table. Each row in table has unique ID. I have a button in each row of GridView that should remove this row from database. My ObjectDataSource returns Object, this returned object contains ID (and some other information, like name, user etc...

ASP:GridView does not show data with ObjectdataSource

I have been trying to bind a DataGrid with ObjectDataSource having custom paging but no output is display on my usercontrol. Here is the code I am using <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="LeadId" DataSourceID="dsBuyingLead1" AllowPaging="True"> <Columns> <asp:BoundField ...

Asp.net Listview server side pagination

Hi, My scenario is i will get some data uploads in csv format in my server, that will have more than 60k records. and the column numbers might change file to file, now my problem is i want to display the contents of this in a listview, with pagination. and i don't want to download entire data to client side, i want the data to be retr...

ASP.NET How to implement ObjectDataSource and IRepository

I'd like to use ObjectDataSource with an instance that implements IRepository. I'd also like to be able to flexibly change the IRepository implementation through dependency injection, and switch between one that uses ORM and a fake. I currently don't see a way to do this because the ODS points to a class instead of an instance. Is there...

Optimize Pagination & Sorting with ObjectDataSource having EnableCaching = true

I'm using an ODS(ObjectDataSource) backed-up with a Linq-To-SQL class to populate Gridview on my page. Considering the performance - I've disabled the Viewstate of the Gridview and enabled caching in the ODS. Apart from this, I've also optimized the Search method in the Linq-to-SQL class to use the .skip & .take methods to fetch only a...

Does the ObjectDataSource just really suck?

I've never had the need to really ever use any of the .NET Data sources other than the SiteMap datasource however I'm trying to take advantage of the built in CRUD operations on a control which needs to be assigned a data source to correctly work. As I've been working through information online about implementing the ObjectDataSource an...

objectDataSource binding with ASP.NET gridview auto adding parameters

I have a gridview databound to an objectdatasource. Everything worked great until I changed 2 columns from asp:BoundField to asp:TemplateField. These are the UPC column and the Part column. I wanted to show a link button for each of these fields that take the user to another page. Now asp.net expects these two fields to be parameters on ...

Problem with custom paging in ASP.NET

I'm trying to add custom paging to my site using the ObjectDataSource paging. I believe I've correctly added the stored procedures I need, and brought them up through the DAL and BLL. The problem I have is that when I try to use it on a page, I get an empty datagrid. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="PageTest.asp...

How do I get the inserted id (or object) after an insert with the FormView/ObjectDataSource controls?

I have a series of classes that loosely fit the following pattern: public class CustomerInfo { public int Id {get; set;} public string Name {get; set;} } public class CustomerTable { public bool Insert(CustomerInfo info) { /*...*/ } public bool Update(CustomerInfo info) { /*...*/ } public CustomerInfo Get(int id) { ...

ObjectDataSource databinding: Getting object properties following Select Method call.

I am using an ObjectDataSource control to call a MapInfo object. This object has two properties: public IList Visits public int TotalAvailable The select method returns an IList but the TotalAvailable property is also populated. I have set the TypeName in the ObjectDataSource to the MapInfo object but because the Select method only r...

ObjectDataSource does not call SelectCount Method

Hi, can you please help me to find the problem: I want to implement simple DataGrid and ObjectDataSource bundle with paging my .aspx file <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/...

Selected event not raised for ObjectDatasource when enable-caching is true

I've a Gridview control using an ODS(ObjectDataSource) to fetch data. For the best performance and efficiency, I've turned-off the view state of Gridview (i.e. EnableViewstate = "false". And I've also enabled caching in the associated Objectdatasource. This eliminates as much as 50-60% performance optimization because it eliminates the ...

Remove a Parameter from DetailsView ItemUpdating

Here's the setup I have a DetailsView whose DataSource is an ObjectDataSource. The ObjectDataSource has two methods, select and update, that are stored procedures defined in a TableAdapter. The Select stored procedure takes 1 parameter--the record id--and returns the fields populated in the DetailsView. The Update stored procedure t...