Monday, February 24, 2014

How to execute database query in ASP.NET using Store Procedure

To run database query is an important part to process a website or an application. In ASP.NET we take a help of a class SqlCommand. And for this you need to add a namespace System.Data.SqlClient. 

The actual process to run the query in application is

SqlCommand cmd = new SqlCommand("<Store procedure name>", con); 

You can pass the store procedure name or you can place the sql query insist of store procedure.

And to pass any type of arguments you need to do like this.

Saturday, February 8, 2014

Url rewriting in ASP.NET using C#

In web tech URL rewriting is a vital thing for SEO(Search Engine Optimization). Not only for SEO its also important for the security reason. So we will take a look over this URL rewriting in ASP.NET using C# and Global.asax. Its nothing but a class inheriting System.Web.HttpApplication

Open a project and make some page according to your requirement and add a Global.asax file along with this project. To add this go to Add New Item and add Global.asax.

In the Global.asax.cs file you can see there are pre-written  seven methods named..

Friday, February 7, 2014

3 Tier Architecture in ASP.NET C#

For the beginners its an astonishing phrase "3 tier architecture". For me it was same as yours now. But when I get that it seems the easiest thing in .NET. Its all about creating instances for classes and using those instances call the methods present in the class.

Three important layer of this architecture are
  1. Client Layer (class file of aspx page)
  2. Business Logic Layer(BLL) (normal class file)
  3. Data Access Layer(DAL) (normal class file)
 From front end we are getting the data and pass it through BLL and DAL to database. DAL is the end point where the application is connected with database.

Thursday, February 6, 2014

Database Connection in ASP.NET C# Connection String

Database is an integral part of any websites. Its the main part of the whole web technology. So we have to take it with a little bit extra care.... :P

So in this article We are going to watch how to connect your database with your ASP.NET application.

In your application you there is a file called web.config where we have to write our connectionString. You can find it from Solution Explorer. If you didn't find the Solution Explorer then don't worry, here is the path to open Solution Explorer.

View -> Solution Explorer. or press Ctrl+W,S.

Popular Posts

Pageviews