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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Can somebody answer this multiple choice question regarding exceptions ?

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :ASP.Net

You are creating a class library that will be used by several applications. You need to create a custom exception that will be thrown if an application attempts to retrieve product information using an invalid product number.

You need to create the ProductNotFoundException class. From which class should you derive ProductNotFoundException?

A: ApplicationException

B: SystemException

C: Exception

D: ArgumentException


View Complete Post

More Related Resource Links

Multiple choice security question


Which one of the following attribute would you use to minimize the security risk by limiting the assembly's privileges so that it can access only  the boot.ini file ?

a  [assembly:FileIOPermissionAttribute(SecurityAction.PermitOnly,Read=@"C:\boot.ini")]

b  [assembly:FileIOPermissionAttribute(SecurityAction.RequestMinimum,Read=@"C:\boot.ini")]

c   [assembly:FileIOPermissionAttribute(SecurityAction.RequestOptional,Read=@"C:\boot.ini")]

Is a the correct answer ?

Security Question Answer Retrieval


I know there is a method built in for retrieving the encrypted password, but how do I retrieve the encrypted security answer?

What I want to do is have a member profile update screen that the end user can update their password and security question and answer. However, when they get to this page, I want to already be showing the security question (the easy part) and its answer (the not so easy part).

I have updated web.config with passwordFormat=Encrypted and have added a machineKey with the generator (forgot the link, but located on eggheadcafe somewhere).

I haven't done ANYTHING yet, since I already have a user store with hashed information. I wanted to get some functionality done before publishing, wiping the store and recreating users (only a couple developers).


Educational question: How server objects are accessed from multiple client threads?

I will appreciate it if someone can help me to undestand how the following scenario works:   There is remoting server that is registered as WellKnownObjectMode.Singleton. Server implementation: It instantiates a class TestServer that implements interface IFoo interface IFoo { IHelper GetHelper() }   interface IHelper { void StoreString(); }   Implementation of TestServer: internal sealed class TestServer: System.MarshalByRefObject, IFoo { private IHelper> helper = new Helper(); public IHelper GetHelper(string helper){return helper;} }   Implementation of Helper: internal sealed class Helper : System.MarshalByRefObject, IHelper { public void StoreString (string val) {}; }   Implementation of a client (simplified; shown to illustrate the question only): static class Program { public static IFoo TestService; public static IHelper Helper; public TestThreads testmultiplecalls; [STAThread] static void Main() { TestService = (IFoo)Activator.GetObject(typeof(IFoo),"ipc://Channel"); Helper = TestService.GetHelper(); testmultiplecalls.Start(); } }   internal class TestThreads { public Start() { for (int i = 0; i < 20; i++) ThreadPool.QueueUserWorkItem((new TestCall(i.ToString())).DoWork); } }     internal class TestCall { private string m_str; public TestCall (string str) {m_str = str;} public void DoWork() { Program.Helper.StoreString(m_str); } }     Que

Question regarding having multiple versions of the .net framework


Hi guys,

Sorry if this sounds silly, but it's been getting to me for quite a while now.  I've been having some issues installing both .net framework 3.5 and 4.0 on my computer since I have certain software that either requires one or the other to run.  I've tried over and over again to install framework version 3.5 from your web site, but each time, the result is the same.  I always get the error that I mustconfigure the framework from the control panel.  Yet I see nothing about that in the control panel.  Maybe it would help you to know that I had first found .net framework through IIS when I went to put that in there, and so I've been trying to install it from there.  Every other framework version works fine except for version 3.5.  I unfortunately cannot provide any logs since my computer is currently with the Gordon college techs due to another issue, but any help on this would be appreciated.  Thanks. 



Data Flows in SSIS - Mapping Multiple source tables to Destination table **Newb question**

Hi I am new to SSIS and had a basic question. I have around 30+ tables in a db that needs to be migrated to a newer schema in the DB. The data flow task seems to be ideally suited for my requirement. My question is do I need to create 30+ different data flow tasks for this which will get executed one after the other or is there a better way to migrate large number of tables. Also how are referential constraints taken care of during such migration. Thanks and Regards, Ganesh Ranganathan
Ganesh Ranganathan
[Please mark the post as answer if it answers your question]

multiple default value on a choice column



can I have multiple default value on a choice column?



Regex question with multiple replaces


I've never been good with Regex, but I'm sure this can be done. I'm basically trying to regex to avoid using two Replace methods on a string. For example, how would I replace a and b in a string with a space using regex in C#? Or how would I convert this line?

myString.Replace("a", " ").Replace("b", " "); 

Reflection question - how to tell which exceptions a method throws


I've found an ExceptionHandlingClauses collection in MethodBody but I'm looking for the exceptions that are *thrown*. You know, when you look at the ReadByte method of FileStream on msdn and you see that the ReadByte method throws two exceptions - the NotSupportedException and the ObjectDisposedException. 

How can I get this info programatically?


Quiz with multiple choice using c#


 Dear all,


My task is online quiz with multiple choice questions and with following constraints

- 20 Random selection of questions every time when user log in

- 30 mins duration.

Front End - asp.net with C#

Backend - sql server 2005



Thanx in advance




Can anyone answer of my Question regarding SQL server database connectivity??

I want to connect my sql server database using my desktop application. Now Just tell me can i connect directly to my database using IP Adress in my connection string????? my database

Exist is in other country


Please clear this confusion.


Thank in advance


Revised Question XML Value Method Return Multiple Rows


Question earlier asked and answered to run query to collect sql data from xml schema

was able to collect the scheme from node but query did not return data but xml string


I ran this query

select x.col.value ('




cross apply



Multiple users system design question.



I am designing a web application that will allow users to accept jobs.  Once accepted, the job is locked until completed or released my an admin. 

I have researched this pretty heavily, everything seems to suggest this.  While I think this might be part of the solution, I am still wondering how to reflect the change on the screen. 

The solution we have come up with is to do polling with ajax, but the case we come back to is even if we check ever second...there can be ( and this is very likely ) that two or more users will click the same job at the same time.

Maybe this is as easy as this:

if( job.isLocked() ) {

    // Notify the user, and refresh grid.
    WarningLabel.Text = "Job is taken!!!!";


Our users use IE7 if this matters.  If anybody can give me a confirmation if this is the 'right' way to go about this, or propose other options I would greatly appreicate it.

Lookup field which allows multiple choice - problem when query with CAML


I created one simple list and added one column - lookup - I've chosen some source list and field, then marked "Allow multiple choice". I created new item in that list, by adding more than one valie to that coulm.

The problem is, when I use CAML query, that column has such values:


and it's suppose to be like this:


do You have any idea, why it doesn't query first ID?

Need help creating an admin tool to reset password without question/answer



I'm dealing with a scenario where a legitimate user doesn't have a clue about his password, secret question or the answer. So, I was trying to create an admin tool that would help me in situations like these where the admin should be able to type in username and reset the password without having to know/enter answer to secret question. I understand that I need to make some changes to the web.config for this to work. I thought I made all the changes but my ResetPassword() requests are still not working.

Here's my web.config settings for the provider.

<membership defaultProvider="AspNetMembershipProvider">
      <add connectionStringName="MyConnectionString" 

Please Indicate "Mark as Answer" if a Post has Answered the Question



While reading a reply to your question, you will notice a button with an icon that says "Mark as Answer."   Please select this button when a reply answers your question.


There are several reasons to do this:

  • Our search engine weights Answered questions more highly. By marking Answers you increase the chances that others searching this forum will find the answer directly rather than re-posting the question.
  • You give credit to the hard working folks who ans

Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

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