.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

Can I write my own .NET host?

Posted By :Gowthammanju     Posted Date :June 30, 2011    Points :40   Category :.NET Framework 
Yes. For an example of how to do this, take a look at the source for the dm.net moniker developed by Jason Whittington and Don Box. There is also a code sample in the .NET SDK called CorHost.

You can also find related Interview Question to Can I write my own .NET host?  below: 

What is 'Write-ahead log' in Sql Server 2000 ?

  
Before understanding it we must have an idea about the transaction log files. These files are the files which holds the data for change in database .
Now we explain when we are doing some Sql Server 2000 query or any Sql query like Sql insert query,delete sql query,update sql query and change the data in sql server database it cannot change the database directly to table .Sql server extracts the data that is modified by sql server 2000 query or by sql query and places it in memory.Once data is stores in memory user can make changes to that a log file is gernated this log file is gernated in every five mintues of transaction is done. After this sql server writes changes to database with the help of transaction log files. This is called Write-ahead log. (More...)

How you will write a Connection String in web.Config fiel?

  
Ans) Then write below lines of code:

configuration>
connectionStrings>
add name="sqlconnectionstring" connectionString="Data Source=INTHIYAAZ;Initial Catalog=DB;User ID=sa;Password=sa" />
/connectionStrings>
/configuration>
(More...)

What is the main disadvantage of using IIS to host a service?

  
Using IIS to host your services means that you will not be able to support non-HTTP protocols such as TCP, named pipes, and MSMQ. You will have access to the many built-in features available with IIS such as process recycling and messagebased
activation. (More...)

Is it possible to set SessionState to readonly mode? Readonly mode means, we can only read data from session but we can not write any data in session variable?

  
Yes, it is possible.
EnableSessionState property has a value "Readonly" which actually makes the session state read only.

Thanks. (More...)

How to find data with generics list in VB.NET (Write code).

  
In the code example below, the function "FindData" will return list("sublist") of the objects having matchingKey same as viewstate value.
Dim sublist As List(Of MyClass)
sublist = allClient.FindAll(AddressOf FindData) 'sublist will contain objects matching specified matching condition

Function FindData(ByVal b As MyClass) _
As Boolean
If (b.matchingKey = CInt(ViewState("matchingKey "))) Then 'matching condition
Return True
Else
Return False
End If
End Function (More...)

Write and justify output of - select nullif('test','test')

  
The output will be - NULL
Justification : nullif returns NULl if given two arguments are same else returns the first specified argument. So, for the given SQL, output will be NULL. (More...)

What's the difference between Response.Write() andResponse.Output.Write()?

  
Response.Output.Write() allows you to write formatted output but Response.Write doesnt allow.

Example:Response.Output.Write("{0:d}", "Current Date Time: ", DateTime.Now) (More...)

Can you write a class without specifying namespace? Which namespace does it belong to by default??

  
Yes, you can, then the class belongs to global namespace which has no name. For commercial products, naturally, you wouldn't want global namespace (More...)

How do I host a WPF control in a Windows Forms application?

  
add references to the WPF namespaces (PresentationCore, PresentationFramework, UIAutomationProvider, UIAutomationTypes, and WindowsBase). Next create an instance of the ElementHost control and the control you wish to embed in the Windows Forms application and then hook that control up to the ElementHost control. Then simply add the ElementHost control to your Forms control collection:

ElementHost host = new ElementHost();

System.Windows.Controls.ListBox wpfListBox = new System.Windows.Controls.ListBox();

for (int i = 0; i < 10; i++)

{

wpfListBox.Items.Add("Item " + i.ToString());

}

host.Dock = DockStyle.Fill;

host.Controls.Add(wpfListBox);

this.panel1.Controls.Add(host);

However, if you want to use XAML to describe the WPF control that you want to use in the Windows Forms application, you would need to add an Avalon UserControl item to your project. This will create a UserControl1.xaml file and a UserControl1.xaml.cs file. You can then modify the UserControl1.xaml file to contain whatever XAML you wish to describe your control. Then you would simply create an instance of this control and add it to the ElementHost control as in the above example:

ElementHost host = new ElementHost();

UserControl1 uc1 = new UserControl1();

host.Controls.Add(uc1);

host.Dock = DockStyle.Fill;

this.panel1.Controls.Add(host);

In addition, you will need to modify the project file because the Windows Application does not what to do with the XAML file. You will need to open the project file (.csproj, .vbproj, etc.) in an editor like Notepad and then scroll to the bottom. You will see the following line:



You will need to copy this line and paste it just below the above line and then change "CSharp" to "WinFX" so that the two lines look like:





Now save this file and reload the project using VS and run the application. (More...)

Which function is used to know the current active user within the host Operating System?

  
SYSTEM_USER function is used to know the current active user within the host Operating System.

SELECT SYSTEM_USER

-->Abhisek (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.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend