Questions tagged [objectdatasource]

ObjectDataSource control acts as a data interface for databound controls such as: GridView, Repeater, FormView and DetailsView.

objectdatasource
Filter by
Sorted by
Tagged with
52 votes
5 answers
59k views

Paging & Sorting grids with ASP.Net MVC

I'm new to MVC, and am not following how you'd do paging and sorting on a grid. I'm used to using the asp.Net GridView control with an ObjectDataSource pointed at objects in our business layer - and ...
Scott Ivey's user avatar
  • 41.2k
35 votes
2 answers
23k views

GridView bound with Properties of nested class

I have an object map similar to what's listed below. When I try to bind the properties of NestedClass in a GridView I get the error: "A field or property with the name 'NestedClass.Name' was not ...
Ant Swift's user avatar
  • 20.6k
21 votes
2 answers
41k views

How do I set up ObjectDataSource select parameters at runtime

I'm trying to add parameters to an objectDataSource at runtime like this: Parameter objCustomerParameter = new Parameter("CustomerID", DbType.String, customerID); Parameter ...
TheEmirOfGroofunkistan's user avatar
18 votes
6 answers
13k views

Visual Studio won't update properties of my Data Source

I am using my class "Invoice" as a Data Source. But after adding more properties to it, Visual Studio refuses to refresh the data source and I can't find the new properties in my data source. Tried ...
OMGKurtNilsen's user avatar
16 votes
4 answers
11k views

SqlDataSource vs ObjectDataSource

If a web page needs some data, why not just have a SQLDataSource call a stored procedure? Why use an ObjectDataSource to call a business object that then calls the stored procedure? I understand that ...
Dumb Questioner's user avatar
15 votes
4 answers
29k views

How to sort using GridView and ObjectDataSource?

I have a GridView with an ObjectDataSource and I want to be able to sort it. Paging works correctly, however Sorting gives me an exception: The GridView gridView fired event Sorting which wasn't ...
Jonathan Mitchem's user avatar
11 votes
4 answers
29k views

Storing array of integer values in SQL Server

i want to store an array of integer values in a SQL database table (SQLServer 2005), if possible by using a single column. The integer array will have a length of 7560 values. I am using a ...
spoekes's user avatar
  • 833
11 votes
5 answers
15k views

Can't see or add Website Data Sources in RDLC report in ASP.NET MVC

In the RDLC report, in Design view in Visual Studio 2008, we don't see anything in the Website Data Sources tab and the button to Add New Data Source is grayed out. Only the Refresh button is enabled,...
RobertC's user avatar
  • 323
10 votes
7 answers
23k views

How to get row count of ObjectDataSource

Hello you all How can i get row count of ObjectDataSouce ? I use ObjectDataSource and DataList . I want show some thing to the user for example in a label when there are certain row returned by ...
Mostafa's user avatar
  • 3,075
9 votes
3 answers
6k views

Using generic classes with ObjectDataSource

I have a generic Repository<T> class I want to use with an ObjectDataSource. Repository<T> lives in a separate project called DataAccess. According to this post from the MS newsgroups (...
Brant Bobby's user avatar
  • 15.2k
8 votes
4 answers
12k views

SSRS: Master-detail report with two datasources

I have two local data sources that I can push into the report. Works no problem. But how do I set up the report? One data source contains a list of employees, and info about them. The other contains a ...
Svish's user avatar
  • 155k
8 votes
3 answers
22k views

Return Custom Object <List T> from Entity framework and assign to Object Data Source

I need some guidance with an issue, I am using Entity Framework 4.0, I have a DAL and BLL and am binding to ObjectDataSource on the page. I had to write a stored procedure using PIVOT and dynamic ...
Shokwave's user avatar
  • 313
8 votes
3 answers
324 views

When using an object database, how do you handle significant changes to your object model?

If you use an object database, what happens when you need to change the structure of your object model? For instance, I'm playing around with the Google App Engine. While I'm developing my app, I've ...
Deane's user avatar
  • 8,467
7 votes
6 answers
28k views

GridView not Rebinding Properly After Postback

I have a GridView that has a DataSourceID pointing to an ObjectDataSource. The ObjectDataSource points to a method that returns a LINQ IQueryable by using the TypeName, SelectMethod, and ...
Jason N. Gaylord's user avatar
7 votes
3 answers
8k views

Is it possible to stop ObjectDataSource from auto-binding?

I have a GridView to which I've using an ObjectDataSoure as the data source. The ObjectDataSource is taking in parameters from a TextBox and DropDownList which is then passed into the stored procedure....
Rusty Wizard's user avatar
7 votes
5 answers
9k views

Gridview Paging via ObjectDataSource: Why is maximumRows being set to -1?

So before I tried custom gridview paging via ObjectDataSource... I think I read every tutorial known to man just to be sure I got it. It didn't look like rocket science. I've set the AllowPaging = ...
octechnologist's user avatar
7 votes
5 answers
2k views

ASP.Net 2.0 Application without Business Logic Layer?

Is it "acceptable" to have an ASP.Net 2.0 application without the BLL (Business Logic Layer) as the following? SQL Server Data Storage & Stored Procedures Data Link Layer (Strongly Typed Table ...
Ciro Villa's user avatar
7 votes
3 answers
2k views

Could not find a property named 'xxx.yyy' in FormView (two-way binding for nested properties)

I have this error when I try to update a FormView Could not find a property named 'MainContact.FirstName' on the type specified by the DataObjectTypeName property in ObjectDataSource 'odsForm'. ...
Vinzcent's user avatar
  • 1,448
7 votes
3 answers
10k views

How to Sort on a GridView using ObjectDataSource with TemplateFields

Background: I am working with a GridView and an ObjectDataSource. I am implementing Paging and Sorting. On the ObjectDataSource: objectDataSource.TypeName = value; objectDataSource....
Jonathan Mitchem's user avatar
6 votes
3 answers
8k views

DataBind and Postback

This is a general how does DataBind work questions... I have a simple page with a GridView that is bound (in the aspx code) to an ObjectDataSource. I can look in the Select() function called by the ...
Michael La Voie's user avatar
6 votes
3 answers
23k views

Understanding ObjectDataSource and Select Parameters

I have in a GridView control a TemplateField like: <asp:TemplateField ItemStyle-Width="150px"> <ItemTemplate> <asp:DropDownList ID="ddlFields" runat="server" DataSourceID="...
balexandre's user avatar
  • 74.4k
5 votes
2 answers
15k views

The type "..." is ambiguous: it could come from assembly "..." or from assembly "...". Please

I'm developing a Web Application on Visual Studio 2013 and I have the next problem: The type 'AddressMaintenance.App_Code.DAL.DataSetTableAdapters.VALUESTableAdapter' is ambiguous: it could come ...
Carlos's user avatar
  • 303
5 votes
3 answers
3k views

How to handle an exception is thrown by Select method of ObjectDatasource?

I have a Select method connected to an ObjectDatasource, this method might throw an exception and I don't know how to handle it! The problem is that I'm not controlling it. When the page is rendered ...
French Boy's user avatar
  • 1,491
5 votes
4 answers
3k views

FormView ConvertEmptyStringToNull and binding

I'm using a FormView with an ObjectDataSource and binding using <%# Bind("WhateverProp") %> - and all of my nullable columns are coming back with default values of the type in them. It appears ...
Scott Ivey's user avatar
  • 41.2k
5 votes
1 answer
3k views

ObjectDataSource Delete problems

Enviroment: asp.net framework 2.0 I'm having problems with the Delete method of and ObjectDataSource on a custom object. The Select, Insert and Update methods works fine. Here is the code of the ...
Andres A.'s user avatar
  • 1,339
5 votes
2 answers
906 views

If ObjectDataSource isn't the answer for a large application, what is?

Quoting the answer of Andrew Hare on the This Question. Object data sources are nice for small projects but they do not scale well as you are embedding data-layer information in the UI layer ...
Mazen Elkashef's user avatar
5 votes
2 answers
2k views

Why isn't my SelectCountMethod getting called?

I'm binding a GridView to a ObjectDataSource. I'm expecting the m_ObjectDataSourceGrid_Selected method to fire twice, once for the Select and again for the Count, but it only fires once. What's ...
Homer's user avatar
  • 7,702
5 votes
2 answers
2k views

ObjectDataSource cannot find type when deployed to SharePoint

I'm receiving the following error when deploying a feature containing ASP.NET pages to our development SharePoint servers: System.InvalidOperationException: The type specified in the TypeName ...
Sean's user avatar
  • 2,453
5 votes
3 answers
13k views

How does FormView EditTemplate update values in ObjectDataSource UpdateParameters under the hood?

I have a FormView bound to an ObjectDataSource. * ObjectDataSource definition (omitted portion of it for simplicity)* <asp:ObjectDataSource ID="odsHousehold" runat="server" TypeName=...
Leo Nix's user avatar
  • 2,095
5 votes
2 answers
16k views

Gridview disappears on postback when paging is enabled

I have a gridview that has its DataSourceID property set to a custom ObjectDataSource object. When AllowPaging is set to True, the GridView disappears after a postback. If I set AllowPaging to False ...
adam0101's user avatar
  • 30.1k
5 votes
2 answers
15k views

asp.net objectdatasource pass parameter from control as well as textbox

I have configured a GridView to fill data by an ObjectDataSource. This ObjectDataSource requires only one parameter which is bound to a DropDownList. This all works well. When i load the page, it ...
Shezi's user avatar
  • 1,342
5 votes
1 answer
3k views

ObjectDataSource Update method with dynamic parameters

I have this DataTable that has a varying set of columns except for a sequence number. | Sequence | Value | Tax | Duty | Total | Any number of columns should be accepted with unique column names. To ...
user avatar
5 votes
1 answer
485 views

Why does ValueMember override an empty DisplayMember

When I set a DataSource on a control and want to use .ToString() as DisplayMember, I need to set the DisplayMember last or the ValueMember will override it. MSDN on empty string as display member: ...
EpicKip's user avatar
  • 4,025
5 votes
1 answer
872 views

Modifying a collection returned from ObjectDataSource

Some quick background on what I'm working on: I've got a page with a RadGrid tied to an ObjectDataSource that returns a collection of objects On that page; I also have two lists; one contains Ids of ...
Jim B's user avatar
  • 8,454
5 votes
1 answer
2k views

How do I Prevent FormView from clearing user's entered Values after Insert Method has fired?

I have been struggling with getting FormViews to work the way Microsoft expects me to for about a day and have figure a bunch of great stuff out. I can catch e.Exception and e.ReturnValue in the ...
SinbadEV's user avatar
  • 203
4 votes
1 answer
6k views

Data binding and user controls

This is really bugging me, so I hope someone can help me a bit 1) Assuming page contains user control, then Page.Page_Load is fired prior to UserControl.Page_Load: a) I assume that if Page contains ...
SourceC's user avatar
  • 3,919
4 votes
2 answers
1k views

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 ...
Herman Cordes's user avatar
4 votes
4 answers
11k views

Objectdatasource and Gridview : Sorting, paging, filtering

Im using entity framework 1.0 and trying to feed out a Gridview with a objectdatasource that have access to my facade. The problem is, that it seems to be particulary difficult and haven't seen ...
Simon Dugré's user avatar
  • 18.5k
4 votes
3 answers
3k views

How can I catch a exception form ObjectDataSource.Updata()

The exception is throwed by database caused a conflicting by FOREIGN KEY.
user avatar
4 votes
1 answer
2k views

ObjectDataSource does not find SelectCountMethod

I am trying to use the ObjectDataSource with enabled paging. This requires me to use the SelectCountMethod (so the grid can know how many pages there are). My ObjectDataSource looks like this: <...
Gluip's user avatar
  • 2,967
4 votes
1 answer
5k views

ObjectDataSource Gridview Insert Fails W/ Empty Values Dictionary

I have a gridview to which I have created an Insert Template in the footer row. I have an ObjectDataSource which is bound to a business object. I have an OnInserting event handler which never gets ...
YonahW's user avatar
  • 16.1k
4 votes
3 answers
2k views

Cancel a Gridview edit during the ObjectDataSource updated event

In my Asp.net web page, I've got a GridView control that is data bound to an ObjectDataSource. The user can edit row directly in the GridView. There are times when the update fails validation. When ...
epotter's user avatar
  • 7,709
4 votes
4 answers
5k views

what characters should be escaped in sql string parameters

I need a complete list of characters that should be escaped in sql string parameters to prevent exceptions. I assume that I need to replace all the offending characters with the escaped version before ...
Slim's user avatar
  • 5,855
4 votes
2 answers
343 views

Object Data Source

I'm creating a gridview using an objectdatasource and it works fine when pulling all records. But when I want to use the selectCountMethod the grid shows no values. I Step through the code and my ...
Robert's user avatar
  • 3,074
4 votes
2 answers
2k views

What is the best way to handle ObjectDataSource exceptions?

I have an ObjectDataSource in an ASPX page calling CRUD operations from a business logic class. When exceptions occur during those operations, I'd like to inform the users of the errors as well as ...
Leo Nix's user avatar
  • 2,095
4 votes
8 answers
12k views

Using ObjectDataSource and DataObjectTypeName, How Do You Handle Delete Methods With Just An Id Parameter?

If I have an ObjectDataSource setup like: <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="Employee" InsertMethod="Insert" UpdateMethod="...
Laz's user avatar
  • 3,504
4 votes
1 answer
4k views

Problem with Object Data Source in ASP.NET (GetData method)

I want to create a report viewer in ASP.NET that presents to the users their data. the data for all the users is located in the same table. for now I created DBDataSet and in the TableAdapter there ...
Ofir A.'s user avatar
  • 3,132
4 votes
1 answer
1k views

ObjectDataSource throws Exceptions

I am working on an ASP.NET page with a GridView and an ObjectDataSource. I want to configure the ObjectDataSource against a class (decorated with DataObject()) in my business layer. A class amongst ...
BlackMael's user avatar
  • 3,198
3 votes
2 answers
694 views

Xpages bean vs object data

What's the difference? When should I prefer one over another? And some minor questions related to this: if I have object data, when is saveObject called? it looks like garbage collector recycles all ...
Ermo's user avatar
  • 91
3 votes
3 answers
15k views

How to change the SelectMethod of ObjectDataSource programatically?

Suppose I have a given ObjectDataSource, this objectdatasource "SelectMethod" property is set to "GetProjectsByUsername" of a class Project and accepting one parameter. <asp:ObjectDataSource ID="...
Sherwin's user avatar
  • 65

1
2 3 4 5
13