DevExpress Xtrareports using a Business object as a datasource - asp.net

I am trying out DevExpress Xtrareports, but have asimple problem that I am not able to find an answer to.
In an Asp.net website project, I want to add a business object to my report as a datasource and then drag and drop the fields from my new business object data source onto the report designer.
Can some one help explain how i do this.
I asssume I have just missed something.
Thanks
Ian

One way to solve this would be to give the designer a DataSet with one or more DataTables representing your business object. You would of course have to write some code to convert your business object to the data table and back.
As a side note DevExpress have a really good support forum and I have always gotten answers to my questions regarding their products. I recommend you try your question there unless you get a really good answer.

Related

Creating Classes from Exising Database

I have ben following through a tutorial that shows how to get started creating a Web Forms Application in ASP.NET...and have got to the part where you create Data Classes. These assume you are starting from scratch and generating the database from code - however - I already have a database created and populated from elsewhere.
Entering line by line to create the Class for each table seems very laborious. (I'm using VB.Net and VS 2013 by the way)
Q1. Can anyone help by suggesting a more automated way of doing this? Surely there is a tool to grab the schema?
Q2. Although the tutorial mentions Entity Framework and Code Behind briefly - having done some reading and research - I am very confused by all of the different terms for data access. Am I using ADO.NET ?? Is the methodology called Code Behind as opposed to something else? Are there better ways to connect to a database and Read/Update/Delete records.
Q3. If I want to use a Data Grid to show the data do I use the generated classes to do this - or just 'bind' the grid directly to the database?
I have been a developer for 40 years but the newer .Net models are causing me some confusion so any advice gratefully received. (and any simple books or tutorials that can be suggested would be helpful).
Thanks
Q1: What you want is to generate "EF Designer from database" by using a Entity Data Model.
In your project add a new item and look under "Data".
What this technique does is auto generating entity classes from your predefined database.
Q2: I suggest you read Getting started with Entity Framework. "Database First" is just a description of how you want to use the Entity framework - by saying you already have a database structure.
Q3: In this case if you use Entity Framework and the "database first" mechanism to generate entities you can databind the gridview from the result of a entity LINQ query, please see this example: Tutorial: Databinding

Dynamically update table rows in entity framework

Can anyone tell how to update table rows dynamically in entity framework? I am new in entity framework. Thanks in advance.
This is a pretty general question, but what you need to do is basically this:
Access your data context.
Get a given object (/record) from your context (/database).
Change the object.
Call SaveChanges() on the data context.
If you are learning EF a site that helped me a lot when I was learning it is http://msdn.microsoft.com/en-us/library/gg696194(VS.103).aspx. It contains lots of information in problem/solution format. You can also look at this book:
http://www.amazon.com/Programming-Entity-Framework-Building-Centric/dp/0596807260/ref=sr_1_1?ie=UTF8&qid=1355991856&sr=8-1&keywords=entity+framework
or this book:
http://www.amazon.com/Programming-Entity-Framework-Code-First/dp/1449312942/ref=sr_1_4?ie=UTF8&qid=1355991858&sr=8-4&keywords=entity+framework
which are both quite useful depending on whether you wish to use the designer or Code First.

Many-to-many updates, deletes etc... vb.net 2005

Forgive what is probably a question that get's asked a lot, but I'm just not getting it. I've searched quite a bit, but I can't quite see clearly from other's posts what I'm missing
It basically comes down to using vb asp.net 2005 and linked tables that have a manny-to-manny relationships, while using a checkbox list.
Can someone please describe, or point to a walkthrough that helps me through this concept? I'd really like to see an example. I'd also like to see how it's done in classic asp or VB asp.net 2.0 so that I can see more fundamentally how it works, before venturing into the new entity framework, and LINQ.
If there are two tables (say People and Catagories) and they are related with a linked table (PeopleCategories), how might I use a FormView in ASP.net to first display, but ultimately edit, insert or delete one or all the categories that are linked to that People record with the linking table. If I can really fully understand this, I would be very, very, very thankful.

Suggestions on which ASP.NET control to use?

I've received a project for internal use. My application has to store about 100 rows of meta data of a game and each row has about 15 fields maximum. Fields can be game name, game category, maker, source code path, etc. I will most likely have to join about 5-10 tables for each row of record. Only a few people are using it and will receive very little hits. Speed performance is not a much of an issue. The rows of data I have to present must be sortable and searchable
My current solution is to use ASP.NET's GridView control with ASP.NET's AJAX UpdatePanel to give it that ajax feel. I'm thinking of using LINQ-to-SQL as my data access layer. I'm thinking of building my own custom search engine but if there's an existing control that has this feature already, i would prefer to use that; anyone know of such control exist? Anyways what do you guys think?
Update #1:
I'm looking into creating a DynamicData website. Any have thoughts on that?
Use ext.js!
Look at the Grid Samples, its a very shallow learning curve and provides you with amazing results in little to no time.
http://extjs.com/products/extjs/
Basically, you expose your data via a web service (asmx or WCF, your choice), throw the Ext.Js grid onto your html/aspx page and point it at your webservice. Configure the control for things like sorting/searching/expanding/grouping/paging etc (use the api reference http://extjs.com/deploy/dev/docs/).
ASP.NET Dynamic Data looks really cool, particularly for sites where you've got:
lots of data
not a lot of worries about performance
no / little desire to skin / design the site
no / little desire to extend existing / write new functionality.
So I'd say that's a good match for your project.
Gridview is your best bet. It's so powerful if you know how to use it correctly. It does automatic sorting and if you can code pretty well you can get the data to be filterable(if that's a word). It also makes the Connection to the database for you....so in my opinion, you can't beat the gridview when it comes to reports like that.

Silverlight Datagrid - Getting The Data?

This may sound stupid....I've followed Scott Morrisons Blog and have implemented a silverlight datagrid and populated it with some data. My question now is, when I edit the datagrid and change some of the data, how do i then retrieve it back?! I guess what i'm trying to say is - does it get posted back somewhere!?
Well, when you bind your columns of your data grid to the properties, you should specify that the binding is a two-way binding. This will update the back end data as the grid data is changed.
For a more thorough read, you should look at this article.
Following Brad Abrams MIX09 tutorials located on his blog has ALL the answers I could have possibly ever wanted when starting out with such a powerful framework.
Brad's Blog

Resources