Simple Data access / download ASP.NET - asp.net

I am a winforms programmer and need to setup a data access website for our sql server database. The database contains weather data (wind, temperature, etc..). I would like users to be able to select a start and stop date and the to download the dataset. I know this should be simple to build, but I would like some advise on what is the best technique.
Do I need entity framework? We have a license for Developer Express ASP.NET. Any ideas to use, since I am totally confused about all the options available and I haven't build any ASP.NET website in a long time.....
Thanks,
Erik

For a first pass/prototype, I'd suggest you use ADO.Net and see how it runs with your datasets. Then, once things are clearer I'd maybe look into an ORM. Based on the use case you mention ORM might be overkill.

Yes with license for Developer Express ASP.NET. you can use Entity Framework
If you want work with ORM technology. mapping relational object; yuo have wizard who facilitate your cretaion of database and mapping
http://msdn.microsoft.com/en-us/data/ef.aspx
You can also use just ADO.Net with adapter of datas, stored procedure, dataset datatables, etc....

Related

Create webapp with full stored procedures

I want to create a web application, all actions (Create, Update, Delete) should be done using SQL stored procedure. Every action in the web just calls a stored procedure and receives json data to render the view.
So what is the best framework that I can use? Please help
So what is the best .Net framework that I can use?
Every .Net Framework has ways to retrieve data from database. So, it doesn't really matter what version of .NET Framework you use.
I believe you would like to know what kind of library you should use for Store Procedures. If so, you might want to look at Dapper ORM.
Dapper ORM is created by Stack Exchange, and used in a lot of sites including Stack Overflow.
It basically is a wrapper around ADO.NET to map SQL result to strongly type object. If you have to do the mapping manually, it is very tedious and error prone process. So, I highly recommend using Dapper ORM if you have to call Store Procedures.

What is better for my ASP.NET project using (Server explorer) or DBconnect class?

I have ASP.NET project and I want to know what is better to use.
ODBC connection and with Server Explorer (drag and drop make DataSet and modify it) or do some DBconnect class with connection to database, queries and use it for GridView?
When I use server explorer, I don't have good feeling because all logic is on aspx page and I do not separate from the application layer logic layer.
It will be a lagre application, databese(PostreSQL) have 18 tables and difficult constraints and application have to generate some documents etc. .
"Better" depends entirely on your situation. Is the purpose to get something done as quickly as possible for internal users at your company, or is this going to be a commercial site that will need to be highly extensible and needs to be as easy as possible to maintain? Will you need to integrate with other platforms possibly built using other languages at some point? The answers to all of these questions should affect your decision.
If you're looking to separate your project into distinct layers, then I would recommend an ORM such as NHibernate or Entity Framework (there are other commercially available ORM products out there, but these are the ones I'm familiar with and which you can easily get help with on this site).
Create a DataSource with LINQ to Entity. It let you the liberty of LINQ with the peace of mind of when you change something il will break your build so you will be able to debug more efficiently.
Well if you have total flexibility, I would recommend using C# ASP.NET 4 with MVC3 razor for the UI and application code. Use Entity Framework 4.1 code first for the data access layer.
This way you will always work with real objects that you create, and with List<realtype> instead of the total mess that exists with datasets.

Rewrite the same asp.net application again

I have a asp.net application which is written in the traditional method [SqlConnection. SqlAdapter.. ..] in data access layer, I can see that every time we are making a connection and using adapters. Code is written in a very dirty manner. I have been given the task to re write the application in standard/best practice way.
i have all stored procedure already written, is there any way I can use a tool like which will help me in writing the business layer and data access layer?
I suggest you to go for codesmith. As you have all the Stored procedure already written you can either go for the LINQ to SQL feature.
For the DAL, you could use Entity Framework 4. The business logic could be wrapped up by hand.
Take a look at fluentAdo.net. You can use it with all your old stored procedures.
But if you really want to rewrite your app, I suggest you to use NHibernate or Entity Framework. They have pretty same set of fetures.

Data Access using ASP.NET, what is the best?

I have been asking my self this question from the time i started workin in the software development field,
What is the best way to access data?
Which gives the best performance?
Which is the best for maintainability?
There are lots of solutions to deal with database in the Asp.Net web app,
Entity framework 4.0
Classes generator using ADO.Net such as Code Author ( i liked the way it works and the way it accesses the database using the data access block in Microsoft Enterprise Library).
i will start a new project tomorrow,and i don't know which approach is better??Any idea?
I'm using Castle Active Record for data access in our new ASP.NET project. It's a great and easy tool that is built upon NHibernate. NHibernate itself is a great ORM for .Net.
There is no "best". There is only preference. Some like MVC, some like WebForms, some like Dynamic Data. Entity Framework works nicely, as does LINQ to SQL(although I hear that one is being deprecated, but I'm fuzzy on that.) All work well.
Personally, I like WebForms, but if I want a quick and dirty CRUD app, I always opt for Dynamic Data, and if I need additional functionality mixed in, I can throw in some standard WebForm aspx pages.
Performance wise, I don't know that there's inherently a big difference. All use the same code under the hood. All are based on ADO.NET. Entity Framework and LINQ to SQL seem to have additional overhead compared to the old-fashioned WebForms, but proper DB design and planning is probably of greater importance.

What is a good alternative to SQL Server for ASP.NET applications?

I've been looking into a lot of database's recently, and am not sure if it's because I'm bored or what, but I want to create a few web applications using database's other than MS SQL Server. Any suggestions that tie into ASP.NET nicely?
I'd recommend VistaDB and MySql.
I'd consider MySQL as the obvious alternative.
However, fundamentally one relational database is pretty much the same as another, more so when accessed through something like ADO.NET. If you're bored with SQL Server then rather than looking for an alternative why not look at trying different data access strategies?
You don't mention whether or not you're using an ORM (object relational mapper) which can make working with databases a lot more enjoyable than using standard ADO.NET, such as:
NHibernate
Entity Framework
Linq to SQL
Subsonic
IMO, sticking with SQL Server but trying out a few different ORM's would be much more interesting than switching to a different database altogether.
Or how about looking into using a document database, such as RavenDB?
I suggest you take a look at Connectionstrings.com. Most databases there have a .NET provider available.
Define "good".
Do you want to have a database as a simple data store, or should the database also implement business logic (stored procedures, triggers)?
Do you want to ship your apps and therefore require easy of installation?
Does it matter if the database is commercial, when MSSQL offers a free version?
As #richeym pointed out: are SQL statement a sufficient interface, or do you require an ORM?

Resources