Skip to main content

Posts

Showing posts from December, 2011

How to get Dropdown Selected value using javascript in ASP.NET?

I have dropdownlist box, when I change the value in the dropdownlist box javascript function get fired. And it will shows the selected value in the popup box. HTML So first add an aspx page into your project & paste the below code for asp:dropdownlist under the form div section: < asp : DropDownList ID ="DropDownList1" runat ="server" OnChange ="javascript:GetDropDownValue()"> < asp : ListItem Value ="1"> C# </ asp : ListItem > < asp : ListItem Value ="2"> ASP </ asp : ListItem > < asp : ListItem Value ="3"> WPF </ asp : ListItem > < asp : ListItem Value ="4"> WCF </ asp : ListItem > < asp : ListItem Value ="5"> C++ </ asp : ListItem > asp : DropDownList > Javascript Add javascript function in head tag function GetDropDownValue() {

Create First WPF Browser Application

Are you new to WPF? This article is help to understand and run your Browser application first time. We create a simple WPF Browser Application In Microsoft Visual Studio Open menu File -> Project Select “ WPF Browser Application ” Click “ OK ” Button Here we have one textbox and Button Page1.xaml < Page x : Class ="FirstExample.Page1" xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns : x ="http://schemas.microsoft.com/winfx/2006/xaml" Title ="Page1"> < Grid > < StackPanel > < TextBox Margin ="103,30,102,35" Name ="txtName" Width ="100"> TextBox > < Button Margin ="103,50,112,145" Name ="button1" Click ="button1_Click" Width ="100"> Click Me.. Button > < / StackPanel > < / Grid > < / Page > Page1.xam

Difference between Destructor, dispose and finalize method?

Destructor They are special methods that contains clean up code for the object. You can’t call them explicitly in your code as they are called implicitly by GC (Garbage Collector). In C# they have same name as the class name preceded by the "~" sign. Like- class MyClass {     public MyClass()     {     }     ~MyClass()     {     } } Dispose These are just like any other methods in the class and can be called explicitly but they have a special purpose of cleaning up the object. In the dispose method we write clean up code for the object. It is important that we freed up all the unmanaged resources in the dispose method like database connection, files etc. The class implementing dispose method should implement IDisposable which is inherited by interface and it contains GC.SuppressFinalize method for the object it is disposing if the class has destructor because it has already done the work to clean up the object, then it is not necessary

Cross Join in SQL-Server

Cross Joins produce results that consist of every combination of rows from two or more tables. That means if table A has n rows and table B has m rows, a CROSS JOIN will result in n X m rows. There is no Where Condition used in cross join SQL CROSS JOIN syntax: SELECT * FROM [TABLE 1] CROSS JOIN [TABLE 2] OR SELECT * FROM [TABLE 1], [TABLE 2] Example CREATE TABLE [dbo] . [Student] ( [StudID] [int] IDENTITY ( 1 , 1 ) NOT NULL, [StudName] [varchar] ( 50 ) ) CREATE TABLE [dbo] . [Division] ( [DivisionID] [int] IDENTITY ( 1 , 1 ) NOT NULL, [DivisionName] [varchar] ( 50 ) ) INSERT INTO Student ( StudName ) VALUES ( 'ABC' ) INSERT INTO Student ( StudName ) VALUES ( 'XYZ' ) INSERT INTO Division ( DivisionName ) VALUES ( 'Division 1' ) INSERT INTO Division ( DivisionName ) VALUES ( 'Division 2' ) INSERT INTO Division ( Di