objectdatasource

VB.Net: How to use an Object data source in report (.rdlc)

白昼怎懂夜的黑 提交于 2020-01-10 03:18:06
问题 My question is similar to this one but I'm having some problems with the actual implementation. I've got a report (.rdlc) in the business layer of a 3-tier app. I've got an object in the BL ( EmployeeManager ) which has a GetEmployees(Expression as Expression(Of Func(Of Employee, Boolean))) As IQueryable(Of Employee) method. As I didn't want to try and pass a lambda in directly (at least not until I've got something working), I've created a ReportData class in the BL which wraps the

Type safe objectdatasources

泄露秘密 提交于 2020-01-06 18:55:49
问题 Is there any way to make asp.net objectdatasources to be type safe. Meaning I get a compile time error if parameters or datatypes change during refactoring? Does anyone know any other method? Or can recommend any other way to do it? I find manual binding tedious. What is other people doing? Thanks 回答1: No, all binding is with strings holding property/column names. Maybe consider a Test project (Unit testing). That would be my answer to the last part. 来源: https://stackoverflow.com/questions

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

不想你离开。 提交于 2020-01-06 17:29:11
问题 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 DB round-trip .. courtesy ODS Caching. So, after this I got stuck into the famous "ODS sorting" issue but I managed to invent a tricky solution for it and its

How to work in Crystal Report with Object Data Source?

落花浮王杯 提交于 2020-01-06 14:34:11
问题 How to work in Winforms Crystal Report with Object Data Source? So far I have found web-links to use Crystal Report with DataSets or Databases directly. Can anyone show me how to do it like this? 回答1: its the same as before... reportDocument.SetDataSource(List1); 回答2: <CR:CrystalReportViewer ID="crvmyDataReport" runat="server" ReportSourceID="crsmyData" EnableDatabaseLogonPrompt="False" DisplayGroupTree="False" EnableParameterPrompt="False" ReuseParameterValuesOnRefresh="True" BorderStyle=

Passing complex object parameter to ObjectDataSource Select

混江龙づ霸主 提交于 2020-01-05 09:21:28
问题 I am using an ObjectDataSource and I would like to pass a custom object as the select parameter. Here is my DL method: public static Collection<AdminUserEntity> GetUsers(ClientEntity currentClient) { } So when I configure my ObjectDataSource I choose the AdminUserEntity as the buisness object to bind to and then choose GetUsers as the Select method but as you see it takes a complex type as a parameter and I don't know how to specify this using the wizard or manually. After some more digging I

ObjectDataSource Gridview Insert Fails W/ Empty Values Dictionary

≯℡__Kan透↙ 提交于 2020-01-01 05:48:07
问题 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 fired. The program encounters an error once I call .Insert on the ObjectDataSource. The error I receive is that there are no values and that I should check to make sure the values dictionary is not empty. I do not see a way to insert with a dictionary as a parameter. I have seen mention of grabbing

nhibernate 2.0 Efficient Data Paging DataList Control and ObjectDataSource

拟墨画扇 提交于 2019-12-31 02:09:25
问题 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()) { try { userList = _session.CreateQuery("Select u from User u where u.DateSubmitted is not null") .SetFirstResult(rows * (pageIndex - 1) + 1) .SetMaxResults(rows) .List(); tx.Commit(); }

Asp.net: Sorting with gridview and objectDataSource [closed]

一世执手 提交于 2019-12-26 13:33:39
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . how I do a sorting in a gridView with data bound by a ObjectDataSource? 回答1: Here is a question that has been previously answered. For the actual sorting, you would call collectionOfObjects.OrderBy(x => x

Wrestling with ObjectDataSource - other controls and variables not defined

白昼怎懂夜的黑 提交于 2019-12-24 14:40:00
问题 I have a Gridview with an ObjectDataSource, sort of like this: <asp:GridView ID="myGridView" runat="server" AllowSorting="True" ondatabound="myGridView_DataBound" cssClass="coolTable" OnRowDataBound="myGridView_RowDataBound" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="myDataSource"> <PagerSettings mode="NextPreviousFirstLast"> </PagerSettings> </asp:GridView> <asp:ObjectDataSource ID="myDataSource" runat="server" SelectMethod="GetSearchResults" EnablePaging="true"

ObjectDataSource.Select() not always firing on page postback

一世执手 提交于 2019-12-24 08:24:50
问题 I have a form with: 1 text box ("MyTextBox") 3 check boxes ("MyCheckBox1", "MyCheckBox2", "MyCheckBox3") 1 submit button ("MySubmitButton") 1 ObjectDataSource ("MyObjectDataSource") 1 GridView ("MyGridView") My ObjectDataSource looks like this: <asp:ObjectDataSource ID="MyObjectDataSource" runat="server" SelectMethod="MySelectMethod" TypeName="MyTypeName"> <SelectParameters> <asp:ControlParameter Name="MyRegularString" Type="String" ControlID="MyTextBox" PropertyName="Text" /> <asp:Parameter