h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

C# Interview Questions

C#.net Interview Question:
 Is it Possible to use var Keyword for global Declaration?
 Is it possible to use Keychar value in Keyup Event?
Difference between Form_loading and Form_activated?
Explain Types of Data Source in .net?
What are different types of Delegates?
What are the Keywords apply to event?
Which is a basis for event?
Where to use default keyword?
Is it possible to change the const keyword object?
Is static modifier allowed in a Constant declaration
List out of implicit converted of char?
Is it possible to use more catch statement in the Try catch statement?
What is the default value of bool value?
Can we use events with threading?
How to stop longThread?
Which namespace has Threading?
Difference between Boxing and unboxing?
How to get Default value in C#.net?
How to get Default value in C#.net?
When are validating and Validated events suppressed?
Difference between Double.Parse and Double.TryParse ?
What method do you call on a delegate to run it on a background thread?
What keyword provides thread synchronization?
How to set or remove a breakpoint at the Current Line?
What is the Maximum Parameters using in the Methods?
How to use Pascal and camel case in a Program?
What is the Function Key for Code Editor?
How do you call a Member method and pass a value Type by reference?
How do you declare a Numeric type to String?
What is Purpose of using Return Statement?
What is Purpose of using Continue Statement?
What is Purpose of using Break Statement?
What is mean by Dock property?
Explain C# Version
Is it Possible to declare an array variable without initialization?
What is the use of Reflection?
Difference between GETDATE and SYSDATETIME?
Difference between constant and readonly in C#.net
What is use of Trim () function and explain different variation?
what is mean by Trace Class?
What the way to stop a long running thread?
How can you reference currentThread of the Method?
What are the Different levels of ThreadPriority?
What is a thread?
What is the Type of errors?
What is difference between C# And Vb.net?
What is the difference between an EXE and a DLL?



Control Validation in C#.net

Step by step to Control Validation:
Add a Form
Go to Form Property window.
Disable AutoValidate.
Add a Text Box in the Form.
Add a Button in the Form.
Verify CausesValidation is true.
The following code add into Validating Event of TextBox and Click event of Button.
Click Event of Button:
if (this.ValidateChildren())
{
MessageBox.Show("Validation succeeded!");
}
else
{
MessageBox.Show("Validation failed.");
}

TextBox Validating Event:
if (textBox1.Text.Length == 0)
{
e.Cancel = true;
}
else
{
e.Cancel = false;
}

Internal , Protected Protected Internal in C#.net

Protected: Class members and derived members of this class can access.
Internal:
Publicly accessible by all the members of the assembly.
Protected Internal: Members of the assembly and derived class can access.

Validation In ASP.Net

It is a technology for building Powerful and Dynamic application.
It is a Part of .Net Framework.
Basic HTML and CSS Knowledge is preferable.
.NET language is a Independent which means you can use any .Net supported language to make a .Net applications.
What is mean by VWD?
Visual Web Developer
Validation in ASP.Net
Now a days, Validation is a important in the Window application and Web Application.In web application ,validation is a separate control.
Types of Validation:
1)RequiredFieldVaildator
It is a very useful and very easy.You can use it in the Textbox validation .
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%--This is aTitle Part--%> Testing Required Validator
<%--This is a Controls declartation--%>

Note: Use Comment a line : Select a line and Press Ctrl+k,Ctrl+c
Use Uncomment a line : Select a line and Press Ctrl+u,Ctrl+c
2) Comparevalidator: -- It is useful for somecase.It is very useful to compare a two values of two controls
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%--This is aTitle Part--%> Testing Required Validator
<%--This is a Controls declartation--%> First Value:

Secound Value:

Operator: Lessthan,LessthanEqual,Greater,Greaterthan,Equal,NotEqual,DataTypeCheck.
type: currency,Date,Integer,Double,String
try to change the Operator and type based on your scenario
3)RangeValidator:
It is very useful for Date range Specification that user enter within minimumvalue and maximum value.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%--This is aTitle Part--%> Testing Required Validator
<%--This is a Controls declartation--%> First Value:


Delete Particular File Format from Folder using C#.net

This is very easy .User can delete file using File.Delete Keyword .this method is using for deleting file(s) from particular  folder with specified format.
public void DeleteFiles(String Path, String fileType) {
string[] files = Directory.GetFiles(Path, fileType);
foreach (string file in files)
{
File.Delete(file);
}
}
DeleteFiles("Specify Path","Particular File Type");
eg:
if you want to delete a bmp file in a NewFolder in the E Disk.
DeleteFiles("E:\\NewFolder\\","*.bmp");

Passing Data Between tab controls in C#.net

Tab control 1 contains textBox1 and next Button
Tab control 2 contains textBox2.
Click Next Button Event
textBox2.Text = textBox1.Text;
tabControl1.SelectedIndex = 1;