.net

How do you organize your resource files?

We're looking to use resource files (.resx) in an ASP.NET app for storing localized values. There may be thousands of strings in total across the site which we'll want to store. Is there a best practice for organizing values in to one or more resource files? Do you keep all values in one file? Do you separate in to multiple resource ...

How to write to the main exe's .config userSettings section?

Is there any supported API in .NET 2.0 for writing to the userSettings section of the main exe's .config file? The scenario is: Winforms 2.0 application. I have a setting (a database connection string, if you need to know) that has user level scope. This means that each user has a user.config file created by .net when the user saves t...

Streaming video from a live webcam

I building a .NET 2.0 web site for a client which requires a live video streaming feature. i.e. a subscriber of a the site can stream live recording of a an event using his webcam (from his browser) and the guests he has invited can see it in their browsers. I thought Silverlight 2 will bring in those feature but they are not avialble. ...

How to Bind a custom class with no strongly typed properties

hey guys, here are my requirements: I need a simple class with only one Public property and no Public methods (the final Class will be more complex, but for testing this is all I need) The Property is "Item" and takes a "String" as a parameter. It returns a "String" based on the parameter. I then want be able to add instances of this ...

How do AssemblyInfo attributes map to Win32 VERSIONINFO?

When you view the properties for a binary file that contains a VERSIONINFO resource, Windows adds a "Version" tab, which displays that information. Is there a list of which .NET assembly attributes map to which VERSIONINFO fields, so we can control these easily for our .NET assemblies? ...

WPF DataTemplate Run function on button press?

Well the question says it all? I have a DataTemplate with a button is there any way to run a function or some how tell the object that the button was pressed? ...

Graphics.FromHwnd(IntPtr.Zero) returns null, why?

I'm currently investigating a problem with a 3rd party component (DevExpress) in my application. My issue is quite similar to this one DevExpress KB article. I get the same exception with more less the same stacktrace. So I used .NET Reflector to find out, what may be null in this scenario, and the only object which is a candiate to be n...

When does a library deserve the be called "Linq-something" or "something-Linq"?

I just looked at one of those libraries that is of the naming schema "something-Linq" expecting to gain some more knowledge on how to construct expression trees in an elegant way - and was disappointed. Because all I could find were methods that extended IEnumerable - of course with "normal" C# code. Now I have this question: Do non-exp...

ORMs are to RDBMSs as xxx is to OLAP cubes? Does xxx exist?

Is there an ORM-analogue for querying OLAP cubes / data-warehouses? I'm specifically interested in the .NET world, but generally interested in anything ;-) ...

How should I optimize multiple calls in my .net code to a trivial stored procedure ?

I've got a very simple stored procedure : create procedure spFoo(v varchar(50)) as insert into tbFoo select v I've got 50 values to insert into tbFoo, which means in my c# code I call spFoo 50 times. This is a pretty inefficient way of doing this, especially if there's some lag between my program and the database. What do you usuall...

How to Search a value in an Excel from .net application?

I have to search for a value over 5000 records from excel. What is the best approach to accomplish this in windows .net application? ...

.Net default proxy setting

Hello everyone, If I have a client application which needs to call a web service. I want to know the pros/cons and impact if I set default proxy property to true or false in app.config file? Thanks! Here is the property I am talking about. http://msdn.microsoft.com/en-us/library/kd3cf2ex.aspx regards, George ...

c# : Type.GetType called from a dll on exe type string

I've the following class in XmlSer.dll namespace xmlser { public class XmlSer { public Type test(string s) { return Type.GetType(s); } //...other code } } and the following code in MyApp.exe, which links XmlSer.dll as a reference nam...

Why remove unused using directives in C#?

I'm wondering if there are any reasons (apart from tidying up source code) why developers use the "Remove Unused Usings" feature in Visual Studio 2008? ...

How to find out if a .Net Assembly was compiled with the TRACE or DEBUG flag

Is there any way to find out if an Assembly has been compiled with the TRACE or DEBUG flag set without modifying the assembly. ...

How to access application level objects (ie. logger, container, unit of work) ?

What is the best practice on setting and keeping these "global" objects ? I have encountered this problem couple of times with ORM session object (XPO from DevExpress) IOC container (Microsoft.Unity) Logger (from The Object Guy) I have come up with three options on how to deal with this: Dependency injection. This looks extremel...

How to set C# library path for an application?

Hello, I have C# application that uses a dll. When I try to run the application, it can't find the dll, unless it is in the same directory or in GAC. I do not want to have it in the same directory and I do not want to install it to GAC. Is there any way how to tell the application where to look for the library? (For example if I want to ...

Getting Data from a DataGrid

I'm populating a C# DataGrid with some values, and I'd like to retrieve a value from a cell when I click on that. How do I go about doing that with the .NET 1.1 Framework? datagridview1 is not available in .net1.1 only for windows applications ...

Setup a Environment To Test Multiple Printers

Hi, I have to modify an existing printing solution (.NET 2.0, C#) that currently prints documents to a single printer so that it can print to multiple printers, with fail-over capability (if one printer is down, it uses a backup printer). I need to create a developer environment (and later a system test environment) that will emulate a...

What is WinForms' Control.Invoke in WPF?

What do i use instead of Me.Invoke when i use wpf? ...