A DVD collection


First Page

The first page where I've not inserted any data

Well in .NET 3.5, LINQ has made data query, inserting, updating and deleting so easy that, you almost don’t have to write a code.

Second Page

I'm going to insert data

Third Page

After insertion the new data has been shown

All I have done through wizard, except making some change in LinqDataSourceControl, and the change is very small.

The steps are also not very difficult. First of all, I go for a file system new web site in VS 2008. In the App_Data folder, create a SQL Database DVD_Collection.mdf which has one table DVD having three columns : DVDID (int, primary key, auto increment on), Name(verchar 20), Artist(verchar 20).
After creating the database and the table all I had to do was create an App_Code folder. In App_Code folder added new item LINQ(.dbml) and dragging the table into designer section.
Next step is, getting a LinqDataSource in the page where I want to retrieve data and manipulate them and connect it to the table class that LINQ had created.
Finally, in a ListView data control got the LinqdatSource connected and make Inserting, Updating and Deleting property true.
The whole procedure does not require you to write a single line of code.
But the DVD Collection is data base driven. One can add any number of items there without bothering about any error!
The funny part of the whole thing is, in ASP.NET(.NET 3.5), you did not need to write a single line of code to make a data base driven site,
But, in PHP, if you want to do the same thing in an Object Oriented way, you need to write a long long code.
In the next post I’ll do the same thing in PHP, and you find what is more preferable to you.
Best of Luck.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s