Go to DotNetFunda.com
 Online : 1269 |  Welcome, Guest!   Login
 
Home > Interview Questions > .NET Framework Interview Questions

call for mock interview



.NET Framework Interview Questions (233)


Now you don't need go anywhere to get the best interview questions on Microsoft technology. We are trying to gather all real interview questions asked from MNCs and put them here. You can also assist us in doing so by submitting .net interview questions. These questions are generally different from certification questions however it may help you in that too.




Assigning a string to an object from specific type to a more general type is called covariance.

In contrast, assigning an array of objects to an array of strings, from general type to a more specific type, is referred to as contravariance.

By using a datatable we can sort the data with out going for a dataview.

DataTable dt = new DataTable();
dt.Select(" select criteria if any " , " sort string ")

DependencyProperty is set to enable declarative code to alter the properties of an object which reduces the data requirements by providing a more powerful notification system regarding the change of data in a very specific way. In .NET, there are two types of properties. One is the normal property & another is the DependencyProperty which has added functionality over the normal property.

Now, let us discuss on how to implement such DependencyProperty to give a powerful notification on data change:

First of all, implement the UserControl class from INotifyPropertyChanged interface:

public partial class MyUserControl : UserControl, INotifyPropertyChanged 

{
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}


Create your own normal Property, lets say the name of the property is “Caption”.

public string Caption 

{
get { return GetValue(CaptionProperty).ToString(); }
set { SetValue(CaptionProperty, value); }
}


Now, register the DependencyProperty to the CLR by calling the Register method by passing the property field that you used to store the data in earlier step:

public static readonly DependencyProperty CaptionProperty = DependencyProperty.Register("Caption", typeof(string), typeof(MyUserControl), new PropertyMetadata(string.Empty, OnCaptionPropertyChanged));



The name of the identifier field of the DependencyProperty will be same as you used in the property after appending “Property” at the end. In this example, our Property name is “Caption”, hence our identifier field name is “CaptionProperty”. Add the PropertyMetaData with default value & callback event handler within the Register method as mentioned in the above code. Mark the identifier as static & readonly so that this will be unique to the CLR.

Now, implement the OnCaptionPropertyChanged event handler:

private static void OnCaptionPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) 

{
MyUserControl myUserControl = dependencyObject as MyUserControl;
myUserControl.OnPropertyChanged("Caption");
myUserControl.OnCaptionPropertyChanged(e);
}

private void OnCaptionPropertyChanged(DependencyPropertyChangedEventArgs e)
{
txbCaption.Text = Caption;
}


The implementation of the DependencyProperty is complete. You can either call it from XAML:

<local:MyUserControl Caption="My First Dependency Property Example" />



or from Code behind:

MyUserControl myUserControl = new MyUserControl(); 

myUserControl.SetValue(MyUserControl.CaptionProperty, "My First Dependency Property Example");

ILDASM (Intermediate Language Disassembler) is installed along with Visual Studio. You can found it inside the Visual Studio SDK Folder.
Version folder name will be depends on your .NET Framework version.
As for Example,
C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\
Now With the help of command
ILDASM
we can open it from Visual Studio Command Prompt.

We can open the ibuilt disassembler provided with framework to check the assembly information.


Modified By :
Moderator 3

System.Data.Common.CommandTree namespace provide classes to create an Exception Tree.

System.ServiceModel.Syndication namespace is used to work with RSS feeds in .NET.

System.Exception class is the base class of all the exception classes in .NET.

System.SystemException provide different classes to handle fatal as well as non fatal errors.

System.Text.RegularExpressions namespace provides classes for Regular Expression

The vsvars32.bat sets the environment variables for Visual Studio. You can find it from %Microsoft Visual Studio 2008\Common7\Tools\vsvars32.bat.

When you start the Visual Studio 2008 command prompt it automatically runs vsvars32.bat.

System.Web.Mobile

System.Web.UI.MobileControls


Navigate to Page: 1 | 2 | 3 | 4 | 5 | 6 | ... | 20 |

 More Exclusive .NET Framework Interview Questions here


Advertisement

About Us | The Team | Advertise | Contact Us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 9/3/2010 3:44:16 AM