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:


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:

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

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

Building Simple Web Application That Stores Image and Provide Viewability…

Assalamualaykum Wr Br…Today we explore the Simple Web Application which allows you to upload image, stores it in DB and finally provides another form which allows to select image which displays in pictureBox.

Lets Quick Start our tour by designing our Form as shown below:


The Browse Button_Click Event code can be demonstrate by the following image as shown below:


The Save Button_Click Event code can be shown in following image as:


The Photos Button creates an instance of the Form2 and calls object.Show method which populates Form2 in Action whose Design contains a ListBox Where Images which stored in DB are populated and based on the selection of the items in ListBox its corresponding image is displayed in PictureBox which is depicted in following images:


The Code for the Form_load event is shown below:


The code for the SelectedIndexChanged event of ListBox is shown below:


The output of the above code is show below as:


Form2 will be displayed as:



Alhamdulliah…Thats all For the Day…Keep Doing It till You Master!!!

Sample Web Appplication To Test * in Test Box

Assalamualaykum Wr Br…Today we build a simple web application which checks the input given by user in textbox whether it contains an Asterik in the text or not..Lets Quick start our tour by Creating New ASP.NET Web Application, to be simple Drag & Drop a textbox and Button. Code the following code as shown below:

the Indexof() function returns integer of the position of an argument specified as parameter of the method IndexOf(). Consider an example,
String a=”Nabil”;
Label1.Text= a.IndexOf(‘N’); // returns 0 as index starts from 0.
a.IndexOf(‘i’); // returns 3 as index starts from 0.

The output of the given Code above is shown as below:
hope enjoyed this simple app…till then Allah Hafiz…

WCF Error “HTTP Error 404.0- Not Found The Resource you are looking has been removed, had its name changed or is temporarily unavailable”.

Assalamualaykum Wr Br…These days I was interacting with WCF service using SOAPUI utility but when I try to access the WSDL of the Service an Error was encountered displaying that the¬†“HTTP Error 404.0- Not Found The Resource you are looking has been removed, had its name changed or is temporarily unavailable”¬†similar to this kind of error it was. At this point I would like to make clear how to access WSDL of Service? WSDL of the service can be accessed with the service file with extension as .svc for WCF and for web service it is .asmx. After much effort, finally with Allah’s SWT grace I found the solution to install some packages which are available at:
C:\Program Files\Microsoft SDKs\V7.0\ServiceModel.exe -i
Install these packages and also reset IIS then try again which resolves the issue…Hope this would help..

Jazakallah Khair…

Practical Session With Ionic zip

Assalamualaykum Wr Br…In my previous blog I summarized the Ionic zip package. Today we xplore the Practical session with it. Design your HTML page as shown below using Visual Studio 2010.
At first You will select the file using File Upload Control then click the Save Button to upload file successfully. Once file uploads, Message is displayed quoting Successfully Uploaded. In Below labels FileName is Displayed With its Initial size. Now as you Click the Compress Button the uploaded file is Compressed and its size is displayed in label. Let us experience the execution first,then traverse the code for better understanding.
Select the file by clicking the Browse Button then click SaveButton which displays the message as shown below:
Now Click the Compress Button Whose output is shown below as:
Code which demonstrates these two behaviors is shown below:
The only thing we need to do is just create an object of ZipFile class then using dot operator access the AddFile method where need to pass the location of the File on the Hard Drive and also finally Save method to save the compressed file to the location specified as string to method. Thats all for today…We would be continuing it further in later sessions…Till Then Have a Great Day..
Jazakallah Khair
Assalamualaykum Wr Br…:)