.net

Java Web App Universal Search GUI Control

I recently saw a demo of a .NET 3.5 product, which has a "Universal Search" widget ... ie, it allowed you to search their entire product, for either your own strings, or their strings, and the results were context-sensitive links to different parts of the application. For example, let's say this was a Point of Sale system, you could sea...

Visual C++ 2010 .NET PictureBox.Image = bmp.

I have a button component that draws to a bitmap using LockBits. At the end of the onclick event handler i use the code. pictureBox1->Image = bmp; However in the MSDN help it says to use the pictureBox OnPaint event handler. The program runs perfectly, and i get smoke/haze/dust effects for free. I would really like to use this method...

Binary numbers only TextBox

I want to validate the input of a TextBox to be a binary number. I know I can do this with RegEx but I wanted a more 'inmediate' validation, like allowing just 1's and 0's to be entered. I thought of using MaskedTextBox but I don't know how to just allow those two characters. ...

Difference between project and dll dependencies in .Net in the final compiled assembly

Lets say I have two projects A and B. A depends on B. I can specify this in two ways: Include A and B in the same solution and specify B as a project dependency for A. This shows up in A's msbuild project as a "ProjectReference" node. Include a reference to the B's compiled dll as dependency for A. This shows up in A's msbuild project ...

In switch statement can we use enum in C#

Suppose we want to give condition using switch statement with the use of enum. Can we do that? If yes, then how? ...

Does anyone know of an itextsharp migration guide from 4.x to 5.x?

I have just looked at using iTextSharp 5.0, however things like table/cell have been refactored. I'm wondering if anyone knows of a clear way to migrate from 4.x to the new version. ...

Tool to extract the sequence of Method or Event calls for .NET?

When i run the application i need to extract the information about the sequence of methods or classes the application touches when any event is performed on the application. Is any there other tool other than profiler? ...

avoiding duplicate transient instance in nhibernate

My main entity (Account) graph looks like the following: Account Manager SalesPerson Trader The Manager, SalesPerson and Trader entity are of type person. Now while creating the main entity (along with inner entities) I need to create a new Person if it doesnt already exist. This introduces a problem, where in if the same (...

In visual studio 2005 build mode drop down, release mode not shown

Hi, Recently I got a project when after opening in visual studio 2005 in build mode drop down, only debug mode is shown but release mode not shown.Project builds successfully in debug mode is there a way to enable release mode. Thanks ...

search result displayed in data grid view

I've customer id, customer name, contact no, address, country name(drop down list). and after inserting the data into the sql database It will displaying in grid view. But my requirement is, I've search button and one text box. after entering the any character into the text box then I click the search button. The result will be display i...

Copy a Google Docs Spreadsheet using Google .NET API

Hi, I'm wanting to copy an already existing Google Docs Spreadsheet to a new Google Docs spreadsheet. I dont think the v2.0 .NET API can handle it natively (or if so I can't find the class/method), however It looks like the v3.0 protocol can but I'm not sure how to implement this in the current framework or even if it is possible with t...

.NET object creation, whats faster?

IS there a difference between those 2 ways of object creation? new MyClass() { Id = 1, Code = "Test" }; or MyClass c = new MyClass(); c.Id = 1; c.Code = "Test"; Whats faster? I am assuming there is no difference between the 2. Thanks :-) ...

Is there any concept in c++ like reflector in .Net?

i like to get code from c++ dll ,i know we easily get from .Net dll by reflector. Is there any method available in c++ for this? Thanks In Advance ...

C# insert string to database issue

Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 + ADO.Net + SQL Server 2008. I have some C# string type variables, and I want to insert them into database as type DateTime, any code samples? My problem is how to do the conversion from string to database DateTime type. thanks in advance, George ...

What is the reason behind this huge Performance difference in .Net 4

I was just doing some research on RedBlack Tree. I knew that SortedSet class in .Net 4.0 uses RedBlack tree. So I took that part out as is using Reflector and created a RedBlackTree class. Now I am running some perf test on this RedBlackTree and SortedSet inserting 40000 sequential integral values (starting from 0 to 39999), I am astonis...

Return Null or throw Exception in retrieval method?

Possible Duplicate: Return 'null' or throw exception Say I have a method public Person LoadPersonFromDatastore(int personId) { ... } What should I do if the person was not found? Is it best to return null or should I throw an Exception? My opinion would be not to use an exception here since it adds no useful information i...

How to know If an element is going to be render out of bounds?

Hello all, I am currently developing a control that shows a "linked label" everytime the user adds a visual item to another UI component. When that happens, I link the label in the control to the item added and by clicking over the label the item in the list will be shown. Well, the problem is that this control can be included in a Fi...

When to use Parallel.For?

I have recently moved to C#.net 4. I love Parallel.For, but not sure when to use and when not to. I know that when order is not important for me - I'll use it. But are there any tests regarding the overhead of working with Parallels? Meaning, if my loop runs only 10 times (and performs very little logic) - should I avoid Parallels? Are...

InvokeMember call is throwing MissingMethodException

I am invoking one of the functions from assembly but I am getting MissingMethodException. I have open exe in .netreflector and show that function is available at right place though it is giving error. Here is the code. private void button2_Click(object sender, EventArgs e) { Assembly obj = Assembly.LoadFrom("Solo4O.exe"); ...

Error in reading a uploaded .xls excel file in asp.net

Hi, I have made a program where I read set of records from the database and then save it in a datagrid. From here I make the user download the file as a excel file. Now the user make changes to the file and then upload it again and from here I read the uploaded .xls file and make the necessary changes in the DB. The problem is wheneve...