.net

Fastest way to draw an overlay on an image in windows forms

What is the fastest way to draw an on an image in .net? I'm trying to draw an image on top of another image that have in a windows form control. I know that when I try to draw it directly using loops it takes an Eon. Options I have heard tossed around are GDI+, Direct Draw, or DX10. I start with a bitmap of a fixed size and after apply...

How do you use Presentation Model with Winforms?

Would Like to know how best to implement the Presentation Model pattern. I have read about MVVM but does not apply to me as I'm not using Silverlight or WPF. ...

Grouping by Time ranges in Linq

I've been getting stuck into some linq queries for the first time today and I'm struggling with some of the more complicated ones. I'm building a query to extract data from a table to build a graph. The tables colums I'm interested in are Id, Time and Value. The user will select a start time, an end time and the number of intervals (p...

Centralized Credentials Service For Various Apps

We are researching the possibility to build a centralized credentials storage for internal applications. These apps (vb6, vb.net, web apps in asp.net, etc) are using various instances of SQL servers and iSeries. We want to implement a central credentials facility that would act as a security broker. Basically it should work like this: C...

How to use the WPF progressbar ?

Hello I am trying to use the WPF progressbar control with the IsIndeterminate property set to true. The problem I have, is that it doesn't get updated. I am doing something like this: pbProgressBar.Visibility = Visibility.Visible; //do time consuming stuff pbProgressBar.Visibility = Visibility.Hidden; I tried to wrap this in a thre...

Best way to structure your Unit Test assemblies?

I would like to optimize my unit test assemblies. Specifically, I would like to make sure that multiple developers can work concurrently without stepping on each others' toes. What is the best practice when creating unit tests? One unit test class per real class, unit tests broken up by concern rather than by class, one large unit test c...

Security considerations when deploying an open source application to production

I am using an open source eCommerce application and will soon push the application (including some modifications of my own) to production, i.e. the internet. Given that the code and data structures are freely available online, what are the security considerations/best practices when deploying such a piece of software? ...

validate string - only specific language characters

Is there a way to check if a string contains characters of a given language only? (for example Japanese, Hebrew, Arabic) I'm wondering if there is a way implementing this kind of validation in Javascript\Jquery and in c#? EDIT I'm not willing to check if the string contains valid words of a specific language dictionary. I'd like to ...

How can I display a different ToolTip based on the DataContext DataType in Wpf?

I have an abstract UserControl that I want to show a ToolTip on. This ToolTip should be different based on the Type of the DataContext which is defined in the derived UserControls. Is there a way to define a different ToolTip for each type in the base class? If not, how can I set this ToolTip in the derived UserControl? Here is how I ...

Run .NET Services from command line

How to run .NET services from command line? net start "Sample Service" is not working. ...

SQL Server Varbinary(max): select a subset of bytes from the varbinary field

What is the most efficient way of reading just part of the binary data from a varbinary(MAX) field (not using FileStreams) in SQL Server 2008? When writing data to the column the VarBinary.Write() function is available in T-SQL, allowing bytes to be written to the field incrementally, but there doesn't appear to be a similar function a...

How to save a table(DataTable) into a single cell in a database?

Is it possible to save a DataTable into SQL database in one cell of type binary for example and read it back again into a DataTable? ...

How can I patch .NET assemblies?

If I compile a C# project twice, I will get two assemblies. These assemblies aren't exactly the same (using a binary diff). I can think of reasons why this is so, but the fact remains that the source for the two assemblies are identical. I am concerned with creating a patch between these assemblies, and applying the patch on a customer...

Implementing IConvertible.GetTypeCode

I'm nitpicking, I know. But when implementing the IConvertible interface on a structure that contains only a boolean value (and thus has only two states) what is the recommended value to return from IConvertible.GetTypeCode? The structure is implicitly convertible and comparable to boolean and in nearly every aspect other than string and...

Whether to create a custom exception or wait to occur NullReferenceException down the line?!

I am confused. Whether to create a custom exception or .Net base class library has the relevant exception? I am calling some kind of service or framework API and it returns back a null reference which is an exceptional case for my tier. I know that the system won't be able to proceed with null reference and I should get a NullReferenceE...

How to query StarDict (.dict) files using .NET

Is there any API to query stardict (*.dict) dictionary files in .NET? I'm using this for a dictionary look up in my application. ...

How to Consume SOAP 1.2 Web Service Created in WCF by a Java Client?

I'm developing a Web Service Project in which I have to implement a web service that should be interoperable on all platforms. So initially I used basicHttpBinding as it uses SOAP 1.1 but I want the features of WS-* like reliable messaging, security, exceptions. So I used wsHttpBinding which is a SOAP 1.2 standard. Now after deploying o...

Missing Namespace Assistance

Hi, I can't find the following namespace on any of my dev boxes Microsoft.SqlServer.Dts.Runtime; I have Visual Studio Team System 2008 on some machines and Visual Studio 2005 on some. What do I need to install to get this? ...

How can I avoid raising AddressAlreadyInUseException?

I'm running a WCF service, and calling ServiceHost's Open() method will raise an AddressAlreadyInUseException if the adress is ..err .. already in use ! Is there a way to test whether the address is available without raising an exception? ...

Unit Testing Frameworks - What are the key features

I've read a lot about the available .NET unit testing frameworks. What is not clear to me is what are the key features that differentiate the available frameworks. What are the must-have features that you look for when evaluating unit testing frameworks? ...