Sample Application Demonstrating LINQ

Assalamualaykum Wr Br…Today we build simple Web Application which demonstrates insertion of data from UI to data table without using Connection, Command class but using LINQ(Language Integrated Query).

Lets quick start our building by designing the Form as shown belowLinq_desing_form

Associated HTML code is shown as:

Linq_html_code

Now Drag & Drop the dbml file which creates the DataContext Class with various methods and properties. It also creates class as similar to our table which is shown below:
linq_dbml

Now the Button_Click event code is shown below:
linq_code
The above code generates the following output as shown below:

linq_output
Thats all for the Day!!!…Happy Coding…Jazakallah Khair
Which generates the following output as shown below:

Advertisements

Working With ADO.NET – 1

Assalamualaykum Wr Br…Today we start our journey towards ADO.NET. ADO refers to ActiveX Data Object
ADO.NET provides a bridge between the front end controls and the back end database. The ADO.NET objects encapsulate all the data access operations and the controls interact with these objects to display data, thus hiding the details of movement of data.

The following figure shows the ADO.NET objects at a glance:
ado.net_objects

We start a sample application that demonstrates the connection establishment to Database from Front-End.
Design the UI as follows:
ado2
The following code demonstrates the logic:
ado1
The output can be shown as:
ado3
Hope you Enjoyed the journey first phase..There’s a lot more…till then Enjoy coding…