Welcome :Guest

Congratulations!!!

Top 5 Contributors of the Month
ffttt

 Home >> Interview Question >> C# >> Post New Question Subscribe to Interview Questions
You can also find related Interview Question to How do we generate random numbers?  below:

### If all the 6 are replaced by 9, then the algebraic sum of all the numbers from 1 to 100(both inclusive) varies by a> 310b> 330c> 350d> 345

Ans : b> 330 (More...)

### Is there a way to generate more then on .xap file from a same silverlight application.

Since for each .xap file we have to create a new silverlight application.
(More...)

### Can we generate Trigger for two table and give a example ?

yes,we can create trigger on two tables.

CREATE TABLE T4 (a INTEGER, b CHAR(10))

CREATE TABLE T5 (c CHAR(10), d INTEGER)

CREATE TRIGGER trig1
AFTER INSERT ON T4
REFERENCING NEW AS newRow
FOR EACH ROW
WHEN (newRow.a <= 10)
BEGIN
INSERT INTO T5 VALUES(:newRow.b, :newRow.a);
END trig1
(More...)

### How do you generate documentation from the C# file commented properly with a command-line compiler?

Compile it with a /doc switch (More...)

### How can we find out odd and even numbers?

int input=50;

input=input%2;
if(input ==1)
{
response.write("this number is odd number");
}
else
{
response.write("this number is even number");
} (More...)

### How do you generate a strong name?

.NET provides an utility called strong name tool. You can run this toolfrom the VS.NET command prompt to generate a strong name with an option "-k" and providing the strong key file name. i.e. sn- -k < file-name >
What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?
The Debug build is the program compiled with full symbolic debug information and no optimization. The Release build is the program compiled employing optimization and contains no symbolic debug information. These settings can be changed as per need from Project Configuration properties. The release runs faster since it does not have any debug symbols and is optimized.
(More...)

### How to select the top n numbers from an IList using lambda expressions?

Use Take() extension method. (More...)

A)900

B)1024

C)1800

D)Below 900

(More...)

### What are the correct version numbers for C#?

These are the versions of C# known about at the time of this writing:

C# 1.0; released with .NET 1.0 and VS2002 (January 2002)
C# 1.2 (bizarrely enough); released with .NET 1.1 and VS2003 (April 2003). First version to call Dispose on IEnumerators which implemented IDisposable. A few other small features.
C# 2.0; released with .NET 2.0 and VS2005 (November 2005). Major new features: generics, anonymous methods, nullable types, iterator blocks
C# 3.0; released with .NET 3.5 and VS2008 (November 2007). Major new features: lambda expressions, extension methods, expression trees, anonymous types, implicit typing (var), query expressions
C# 4.0; released with .NET 4.0 and VS2010 (April 2010). Major new features: late binding (dynamic), delegate and interface generic variance, more COM support, named arguments and optional parameters
C# 5.0; unknown time frame. Anounced features as of PDC 2010: async programming, metaprogramming.

http://stackoverflow.com/questions/247621/what-are-the-correct-version-numbers-for-c (More...)

### how to show the line numbers in C# code editor?

Ans ->

Tools -> option

TextEditor ->C# ->Line number option check
(More...)

### What are the different ways to generate proxy in WCF?

A service proxy or simply proxy in WCF enables application(s) to interact with WCF Service by sending and receiving messages. It's basically a class that encapsulates service details i.e. service path, service implementation technology, platform and communication protocol etc. It contains all the methods of service contract (signature only, not the implementation). So, when the application interact the service through proxy, it gives the impression that it's communicating a local object.

We can create proxy for a service by using Visual Studio or SvcUtil.exe.

Generating proxy using Visual Studio is simple and straight forward.

->Right click References and choose "Add Service Reference".
->Provide base address of the service on "Add Service Reference" dialog box and click "Go" button. Service will be listed below.
->Provide namespace and click OK.

Visual studio will generate a proxy automatically.

We can generate proxy using svcutil.exe utility using command line. This utility requires few parameters like HTTP-GET address or the metadata exchange endpoint address and a proxy filename i.e. optional.

svcutil http://localhost/MyService/Service1.svc /out:MyServiceProxy.cs
If we are hosting the service at a different port (other than default for IIS which is 80), we need to provide port number in base address.

svcutil http://localhost:8080/MyService/Service1.svc /out:MyServiceProxy.cs
(More...)

### Which method is used to generate the click event of the Control class for the Button control in C#?

The PerformClick() method of the Button class is used to generate the Click event of the System.Windows.Forms.Control class. (More...)

### What is Proxy and how to generate proxy for WCF Services?

The proxy is a CLR class that exposes a single CLR interface representing the service contract. The proxy provides the same operations as service's contract, but also has additional methods for managing the proxy life cycle and the connection to the service. The proxy completely encapsulates every aspect of the service: its location, its implementation technology and runtime platform, and the communication transport.

The proxy can be generated using Visual Studio by right clicking Reference and clicking on Add Service Reference. This brings up the Add Service Reference dialog box, where you need to supply the base address of the service (or a base address and a MEX URI) and the namespace to contain the proxy.

Proxy can also be generated by using SvcUtil.exe command-line utility. We need to provide SvcUtil with the HTTP-GET address or the metadata exchange endpoint address and, optionally, with a proxy filename. The default proxy filename is output.cs but you can also use the /out switch to indicate a different name.

SvcUtil http://localhost/MyService/MyService.svc /out:Proxy.cs

When we are hosting in IIS and selecting a port other than port 80 (such as port 88), we must provide that port number as part of the base address:

SvcUtil http://localhost:88/MyService/MyService.svc /out:Proxy.cs
(More...)

Quick Links For Interview Questions Categories:
 ASP.Net Windows Application .NET Framework C# VB.Net ADO.Net Sql Server SharePoint Silverlight OOPs JQuery JavaScript/VBScript Biztalk Patten/Practices .IIS WCF WPF WWF Networking Aptitude Others All

### Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.