Allow me to ask a stupid question about dynamicfield. When and why to use it?
Thank you in advance!
Represents a data field displayed in a data-bound control that uses ASP.NET Dynamic Data features.
ASP.NET Dynamic Data is a framework that lets you easily create ASP.NET Web applications data-driven. To do this, it automatically metadata data model and runtime deduce the behavior of the user interface..
Link : http://msdn.microsoft.com/fr-fr/library/system.web.dynamicdata.dynamicfield.aspx
Related
I am building a website to capture data. I have many spreadsheets that are used for data entry or capture. Now I want to mimic these complex spreadsheets on the web forms but I am unsure of the correct control to use.
Data entry must be allowed and live calculations also need to be made similar to formulas on normal excel spreadsheets. Later on the data must be captured into an SQL table.
What would be the best control to use or method to mimic that functionality, albeit that the spreadsheet component is no longer available in visual studio 2010. Is it a data grid?
Thanks
for custom build you can rely on GridView and keep adding on features to it.
however my reccomendation would be to use Devexpress Grid or some other third party controls and build on it. these controls are more feature rich :)
Here is an extension that contains Excel compatible WinForms. Capturing to SQL should be pretty straightforward using the Entity Framework.
http://visualstudiogallery.msdn.microsoft.com/03A0E5A9-4768-461C-9A72-8255A291094C?SRC=Featured
Check to see if the Office Web Components at http://en.wikipedia.org/wiki/Office_Web_Components#Office_Web_Components will meet your needs.
I made a website in asp.net. In it i have used sqldatasource objects or ado.net to bind data to gridview and display it to user.
Now the problem is that i want to make all of this dynamic, i.e. on the basis of user credentials(user name/password entered on login page) i want to display data from corresponding tables which can have different columns.
As long as columns of all the table were same, i solved this problem by using dynamic sql, i passed table name at run on the basis of user credentials but now the table columns will vary.
Please help.
Here are some links for you, you can easily find more using your choice of search engine.
C# .Net L2S Tutorial [Scott Gu's]
C# .Net Entity Framework 4.1 Video Tutorial
VB .Net L2S Tutorial
VB (and C#) Entity Framework Tutorial
I hope that gets you started.
I am looking for some examples for gridview for common tasks like displaying, editing, deleting, paging, sorting, batch updates etc, but WITHOUT using any datasource controls. I would like to bind the data in the code to custom object collection. all the samples I found on the web so far use some data source control, I think Enterprise applications shouldn't be using this pattern. objects in my solution have only business logic and no data access code. instead I use manager objects to do this.
if you have any examples of gridview that performs the common tasks without using any data source control, can you please share them? that would be very helpful. thanks.
Editable GridView in ASP.NET 2.0
Sorting a GridView Bound to a Custom Data Object
Say you had to quickly build a data-entry UI that works in a web browser, which must interface with a business layer, which must interface with a data layer.
You want to connect only to business objects, not directly to the database.
Most of the views of the UI will be simple CRUD operations, with edit/update happening within a grid.
But some of the screens will be more complex, representing many-to-many relationships.
What's the fastest way to achieve this in ASP.NET?
(Note: speed of development is high priority, code quality and re-usability are low priority.)
Entity Framework + ASP.NET Dynamic Data?
If speed of development is the main priority, then go with what you know.
For example, if you know ado.net/enterprise library then go with that. If you know Entity Framework or LINQ, then go that route.
Without a summary of your skills, it's going to be impossible for anyone to tell you the fastest way to get something up and running.
I've written a lot of little business editors like this for my company in the same manner, get it to work quickly, if it's used or needs to be improved, I deal with that later.
Start up a new asp.net project. Add a class library to the solution and reference it from the asp.net application.
Asp.Net Application
Use Master Pages and Themes
Use a repeater for the data lists and command buttons for selecting and deleting.
The repeaters work well for inner lists as well, take note of OnItemDataBound and OnItemCommand.
Use Panels to hold the lists and editors, write some logic to control when to view editors and when to view lists.
If the logic is common, then make some base pages that new editors can use and override.
Class Library
Add your business objects
Add a Linq to Sql class and add database objects as necessary.
To make it simple, you could use the some of the time tested controls and objects:
User Interface Layer: GridView for displaying and providing links for editing and deleting data. Clicking on Edit link may open up a new Asp.net web page that holds FormView for inserting and updating records. Use ObjectDataSource to link methods at the Business Logic Layer to Create/Read/Update/Delete records.
Business Logic Layer: Apart from creating CRUD methods, you might need to use light weight serializable data transfer objects to pass data between different layers and a custom mapper to trnaslate data from and to other layers.
Data Access Layer: Linq to Sql might make the data access and manipulation quick and easy.
It depends on the complexity of the application. I would go with Linq to Sql. But then using Linq to Sql does not necessary provide a good abstraction between the business layer and the data access layer. But I find that using Linq to Sql you can quickly retrieve the data out of the storage and display it on the screen.
Also, if you want fast UI then take a look at dynamic data website. That also uses Linq to Sql or Entity Framework.
One question you must think is that if you need good design or RAD.
I'm looking for a bit of advice with regards to the structure of an application I'm tasked with.
I need to have a series of webforms to store some data, most of the data is the same but each form would have some differeing data depending on the form used.
Would a base class then a series of classes inheriting from this for the specific data be best to use?
As in:
order - compAOrder
- compBOrder
- compCOrder
How about strucuting the database for this sort of application structure?
The answer to this kind of question is allways "It depends" but here is a possible solution:
Program the system with a single web page for form data input.
Use a query string value to identify which form it is.
Hide and enable fields depending upon which form it is.
Have a single data table that has all the possible fields.
Hope this helps
Shiraz
I eventually went with a catch-all table with all the fields and different forms.