.net

Best way to change ListBox selection to be a toggle selection

I have a ListBox control that I want to change into having a toggle selection. i.e. Click once on an item selects it, click again it deselects it. Also, clicking another item in the list should do the default action of deselecting the previous item and selecting the new one. What's the best way of achieving this? ...

Which language is easiest and fastest to work with XML content?

We have developers with knowledge of these languages - Ruby , Python, .Net or Java. We are developing an application which will mainly handle XML documents. Most of the work is to convert predefined XML files into database tables, providing mapping between XML documents through database, creating reports from database etc. Which language...

How to detect image format in a stream

I need to detect Image format to save a image like image1.jpg, image2.gif, but i only have a stream, and i do not know the image format(gif, jpeg, png, etc) Is there a way to detect imageformat from a stream? ...

Creating WCF applications without svcutil.exe?

How to create a WCF application without using the svcutil.exe tool? ...

C# and CLR features confusion, what feature deserves to be described strictly as C# feature?

I've got to write few words about C#, generally piece of cake? No! I've searched through various internet resources and books and what i got is kind of headache. For example Garbage Collector some sources says that this is C# feature, other that CLR got this feature and C# along with all other .NET languages got it by default. Ofcourse...

Set selected value in SelectList after instantiation

Am I right to think that there is no way to set the selected value in the C# class SelectList after it is created? Isn't that a bit silly? ...

Can I create a thread that can modify the user interface, and that I can abort?

I have a lengthy user-interface operation on my form which is triggered whenever an event is fired. Rather than have the UI block while the operation takes place, I'd like to perform the operation in another thread, and abort that thread and start again if the event fires again. However, to safely alter controls on my form, I need to u...

[ASP.NET] Expandable Rows on a Gridview

Does anyone have any insight on how to have each row in a Gridview expand to show a DIV or PANEL that has a form of elements, i.e. a simple form of textboxes, etc. I don't need a nested Gridview showing results or using DynamicPopulate. I have tried some techniques from a DataGrid Expandable Row, but ran into some problems trying to acc...

In C#, can I know in the base class what children inherited from me?

Hi, I have a problem. I have a base class vehicle and some children classes like car, motorbike etc.. inheriting from vehicle. In each children class there is a function Go(); now I want to log information on every vehicle when the function go fires, and on that log I want to know witch kind of vehicle did it. example: public class vehi...

Design Question: Building a DAL for a performance critical, high volume application

I'm working on a large scale performance critical asp web application with a pretty much denormalized database (lots of data is duplicated across tables for performance reasons). The application is highly performance critical and large. There is almost no sense of any kind of n-tiered design. I can't touch the database, it's carved in st...

Oracle logon trigger not being fired.

I'm using the following logon trigger on an Oracle 10.2 database: CREATE OR REPLACE TRIGGER AlterSession_trg AFTER LOGON ON DATABASE BEGIN EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_COMP=LINGUISTIC'; EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_SORT=BINARY_AI'; END AlterSession_trg; This is intended to make case sensitive queries a thin...

Can't add object to Velocity cache

I've just installed Velocity on my computer and everything seems to work fine except that I can't add any objects to a cache. I have no trouble retrieving the cache itself, but when I try to add an object, everything just freezes for five minutes, and then I get a time out. My code to connect to the cache host (works fine): // Define A...

IOC Design Resources

I've done quite a bit of searching on this and haven't had much luck finding something cohesive. I'm a relatively new developer and have just started in my first professional development position. I know that I have a great deal to learn even in the realm of the basics. Based on listening to PodCasts, reading blogs, papers etc; I've c...

How do I display an icon in the System Tray?

I want to make my .Net application display a notification in the system tray. So I want to show an icon for that, can anyone tell how to do that? ...

How do I set the constructor string of a COM+ component from .NET?

I'm trying to programmatically set the constructor sting of a COM+ component from a C# application. I found the following sample code online, but it throws an exception: COMAdminCatalogCollection Components; COMAdminCatalogClass Catalog = new COMAdminCatalogClass(); string strConstr; string ApplicationNa...

What is the " := " operator in (VB).NET or what is it good for?

I see this from time to time and want to know what it is. I did try google, but its filtering out the characters from the search. I have a few books that don't reference it either. FWIW, I remember in pascal that is was the assignment operator. Can anybody point me to the MSDN or similar page? ...

Is it possible for a .Net 3.5-based web application to use 2.0-based libraries?

I feel like this is a dumb question and I'm missing something, but I haven't even figured out how to search for this one :( Can an application written to target the .Net 3.5 Framework utilize libraries that were written in the 2.0 Framework? Additional information in the answer such as the "why" and/or how this information was found wo...

How to use typeof or GetType() as Generic's Template?

If it harder to explain using words, let's look at an example I have a generic function like this void FunctionA<T>() where T : Form, new() { } If I have a reflected type, how do I use it with the above function? I'm looking forward to do this Type a = Type.GetType("System.Windows.Forms.Form"); FunctionA<a>(); Of cause the above me...

Cursor.Current vs. this.Cursor in .Net (C#)

Is there a difference between Cursor.Current and this.Cursor (where "this" is a WinForm) in .Net? I've always used this.Cursor and have had very good luck with it but I've recently started using CodeRush and just embedded some code in a "Wait Cursor" block and CodeRush used the Cursor.Current property. I've seen on the Internet and at wo...

Visual Studio 2008 will not edit read only files

So, up until today, when I tried to edit a read only file in VS2008, a dialog popped up giving me three options: Edit in memory Make writable Save a copy There was also a checkbox which read "Never allow in memory edits". Suddenly, it has stopped offering these options and simply will not accept any input in the editor window if the...