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

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:

image_upload

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

browse_code

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

Save_Code

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:

form2

The Code for the Form_load event is shown below:

Form2_Load

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

selectedindex_item_Changes

The output of the above code is show below as:

output_form1

Form2 will be displayed as:

output_Form2

output_form2_@

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:
string_asterisk

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:
outpt_asteris
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.
compress_practise
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.
compress_op
Select the file by clicking the Browse Button then click SaveButton which displays the message as shown below:
compress_op1
Now Click the Compress Button Whose output is shown below as:
compress_op2
Code which demonstrates these two behaviors is shown below:
code_compress
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…:)