objectdatasource

Where does the ObjectDataSource cache data?

时光总嘲笑我的痴心妄想 提交于 2019-12-11 07:29:59
问题 I'm considering using an ObjectDataSource as an intermediate between my page controls and my data access layer & object model. Traditionally I have manually created the object and populate it via a series of findcontrol statements when I need to insert/update data in the database. I'm hoping that I can use the ObjectDataSource to marshal data between my object and my controls, eliminating that manual code, as long as the ObjectDataSource doesn't come with a lot of overhead. I noticed the

Asp.net objectdatasource TypeName property error

我只是一个虾纸丫 提交于 2019-12-11 02:51:48
问题 I use ASP:ObjectDataSource for grid data binding. My problem is when I run this code I get error. <asp:ObjectDataSource ID="odsListing" runat = "server" SelectMethod = "MethodNameOfCodeBehindClass" TypeName = "FolderName_CodeBehindClassName" ></asp:ObjectDataSource> Error message The type specified in the TypeName property of ObjectDataSource 'odsListing' could not be found. So I move my code to codebehind site. #region ObjectDataSource for Grid Binding Type type = typeof(FolderName

Comparing 2 linq applications: Unexpected result

与世无争的帅哥 提交于 2019-12-11 02:44:58
问题 I drafted 2 ASP.NET applications using LINQ . One connects to MS SQL Server , another to some proprietary memory structure . Both applications work with tables of 3 int fields , having 500 000 records (the memory structure is identical to SQL Server table). The controls used are regular: GridView and ObjectDataSource . In the applications I calculate the average time needed for each paging click processing. LINQ + MS SQL application demands 0.1 sec per page change. LINQ + Memory Structure

Can’t get FormView values from ObjectDataSource on update

泪湿孤枕 提交于 2019-12-11 02:12:22
问题 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 anywhere in the update’s call stack. My code looks like this: <div id="personInfo"><asp:FormView ID="fvwPerson" runat="server" DataSourceID="srcPerson" DefaultMode

ConvertEmptyStringToNull=”false” and yet the conversion still happens

放肆的年华 提交于 2019-12-11 02:09:52
问题 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 DetailsView’s Update button, ODS ( or is it perhaps DetailsView ) automatically converts T1’s empty string to null, while T2’s empty string doesn’t get converted to null. I

Is this the only way we can force ObjectDataSource to…?

折月煮酒 提交于 2019-12-11 00:28:25
问题 Greetings, 1) I assume ObjectDataSource automatically binds to data source only on first request, but not on postbacks ( else ObjectDataSource.Selecting event would be fired on postbacks also, but it isn’t): A) So only way to force ObjectDataSource to also bind on postbacks is by manually calling DataBind() ? 2) Assuming DropDownList1 has DataSourceID set to ObjectDataSource1 , then first time page is loaded, ObjectDataSource1 will automatically call DropDownList1.DataBind() ( after Page

Why does the UpdateMethod in ObjectDataSource only receive values for properties from visible controls in DetailsView?

社会主义新天地 提交于 2019-12-10 23:59:26
问题 I've written a class that contains Select- and Update-Methods for an ObjectDataSource. The UpdateMethod receives an instance of a called class. My problem is, that only properties that are Bound in the DetailsView are set, the others have their default value. Here's my code: Class declaration : public class Foo { public string Prop1 {get;set:} public int Prop2 {get;set;} } Updatemethod : [DataObjectMethod(DataObjectMethodType.Update)] public static void UpdateQuicklink(Foo item) { // item

ObjectDataSource Selecting method can't 'see' any other control's values

Deadly 提交于 2019-12-10 18:17:32
问题 I don't even know how to state this clearly, and there's too much code to paste it all in here. Let me start off with a general description and maybe it'll ring a bell. I have a DataGrid which uses an ObjectDataSource. The ObjectDataSource uses a SelectMethod that calls another method due to the fact that two datepickers are required to filter the results. When the SelectMethod fires, though, the datepickers are always null. A related issue is that a button is required to cause the

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

好久不见. 提交于 2019-12-10 16:48:47
问题 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 then the select method is called directly by the ObjectDatasource and an unhandled exception is thrown directly. On the other hand, I don't want to make it return empty collection if it has a problem because the collection might be empty without problems. So, where can I handle the exception? Any

Using a list in my ObjectDataSource on my report for the DataSource of a Telerik Chart in report

本小妞迷上赌 提交于 2019-12-10 11:54:47
问题 Hey there I'm trying to use a list (Loans) within my ObjectDataSource (objectDataSource1) object on a report, as the DataSource for my Telerik chart on the same report. The majority of the tutorials I have looked at all show the report querying their database with a SQL string. I feel I'm over looking something silly. I've also posted on Telerik and haven't got a response quite yet. What I want to do is something like this: chart1.DataSource = objectDataSource1.Loans; Or to be able to just