.net

Strange .NET remoting SerializationException with MarshalByRefObject

I'm having a remoting issue in my application. Since the architecture is quite complex, I'll try to make an simple example with dummy names to illustrate the problem. Consider these components: MyApp.Client.exe: client application MyApp.Service.exe: Windows service that hosts the server MyApp.Server.dll: server implementation MyApp.Sh...

MSDataSetGenerator changes NullValue DateTime format in generated designer file

Hello, When I create a dataset in VS 2008 and add a column named "Date" with DataType = System.DateTime and NullValue = 9999-12-31T23:59:59 this gets changed, when running the MSDataSetGenerator tool, in the designer file to private static System.DateTime Date_nullValue = global::System.DateTime.Parse("12/31/9999 23:59:59"); This gi...

SMS - Incoming Message Processing

Hello all, I'm looking for some recommendations on 'renting' a SMS processing gateway. Basically, (without going into the full details) i want my clients to be able to send a formatted txt from their mobile (generic technology) to a SMS gateway (via a service number). I then would like this gateway to run a http (or https) command to p...

Organizing CSS and Javascript in a single template multiproject site.

Let's start with a bit of context. What do I have in my hands? Multiple web applications (All .NET: WebForms and MVC) Common UI template Each application has also it's own UI elements. Multiple files for css/javascript. Some common to all applications, some specific to the application. Tenths of files per page = multiple requests per p...

VB2005 Transparent Label in Menu area

I've read many articles on how to create transparent labels but it seems to me that my particular case is not covered. Very simply I have a label placed in the upper right part of the form, which in fact is part of the menu strip. The label displays some info to the user but I wish it were transparent. Ive tried various methods including...

Need help with LINQ to SQL WHERE-clause on foreign table

Let's say I have these two tables: ParentDataItem ParentDataItemID ...some other fields... ChildDataItem ChildDataItemID ParentDataItemID (foreign key) Name Value Now I want to select any ParentDataItems that have a ChildDataItem with a specified name and value. I know I was way off with my first approach, wh...

What do you think of Microsoft's new RAD tool "Lightswitch"?

What do you think of Microsoft's new develeopment tool "Lightswitch"? Is it worth to take a look on it? I am not sure, who is the target group of this new RAD tool? It seems to me as a kind of Access or Foxpro for Silverlight!?!? Makes it sense to deal with it as a "normal" experienced developer? ...

SharpSSH Progress and Rename

VB2005 and SharpSSH. Using the library to connect to a remote server and copy a file. I have the process working fairly well but have some smaller things which I cant seem to resolve as documentation for the library is fairly thin. I have two routines working. One using the Tamir.SharpSsh class and the other using the Tamir.SharpSsh.jsc...

NUnit unit test cannot find a unmanaged dll in the test class

I'have the following situation: I have a delphi dll (unmanaged) that works. I have a win forms application (a proof of concept application) that works. The dll (and all its dependencies) are copied in the Bin/Debug directory of the application. I've createad a .NET managed library which has a class that is a wrapper around the dll. all...

How can I set the default event to be edited for my custom control in Visual Studio?

I made a custom button by inheriting the Button class. When I double click the custom button in Designer, it makes the event handling function for MyButton.Click: Private Sub MyButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyButton1.Click End Sub How can I make it so that when you double click,...

Keyboard hook changes the behavior of keys

I'm creating a program that installs a keyboard hook to capture all keys and display some text related to them. However, I've hit upon a snag, and that is some keys change behavior when the hook is installed. I'll see about posting a small, but complete, test program, but for now I'll just describe the problem. The problem exhibits it...

How do I count two entries in one SQL Query in C#?

I have two columns in my ForumPost Table: Id and ThreadId. I want to count all Entries in Id and ThreadId for a specific User: Code snippet cmd = new SqlCommand(); cmd.Connection = connection; cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = @"SELECT dbo.ForumPost.ThreadId, " + "Id, " ...

Expression trees: Getting the statements from a MethodCallExpression

I had some problems figuring out a good title, but hopefully the code examples in this post are clear enough. Is it possible, with the help of expression trees (or some other technique), to traverse the whole method "call stack"? Worded differently: When I get an expression tree from an Action-delegate, I would like to traverse inside ...

Replacing repository pattern with an ORM?

This is a repost of another thread i created. I think my first post was a little rhetorical in nature so it was closed so hopefully i can word my question better. There seems to be a push by some of the industry heavy weights to recommend using an ORM over the repository pattern and building your on DL Layer. So in your application lay...

.NET thread safety

The ApplicationException constructor is an instance member so it is not guaranteed to be thread-safe. How do you know if the following code is completely unnecessary? When I say know, I mean is there something in the documentation that says this is unnecessary or have you seen the .NET source code and so you know it is unnecessary? //...

How do I gracefully close another application?

I have a CLI/C++ based install application which needs to close another app I've written, replace the application's .exe and dlls and the re-run the executable. First of all I need to close that window along the following lines: HWND hwnd = FindWindow(NULL, windowTitle); if( hwnd != NULL ) { ::SendMessage(hwnd, (int)0x????, 0, NULL...

Resharper: Code Style Sharing - Enforcing

We have a team of 40+ engineers working on a common code base. We're using resharper, and have been sharing our suggested settings by having a 'definitive' configuration file emailed out which people can import. However, as time goes on we wish to tighten up on various things on new versions and new work, without requiring refactoring o...

LINQ - Convert List to Dictionary with Value as List

I have a List<MyObject> that I retrieve from the database. However, I would like it keyed by a property in MyObject for grouping purposes. What is the best way with LINQ to cast my list to: Dictionary<long, List<MyObject>> I have the following: myObjectList.ToDictionary(x => x.KeyedProperty) But it returns: Dictionary<long, M...

Use LINQ to group by multiple columns and read values of ungrouped columns

I need to group a data table on multiple columns and also read data of un-grouped columns col1 col2 col3 col4 col5 col6 col7 col8 .. col16 Here i am grouping it on col1, col2 ... col6. But facing problems in reading values of col7 ... col16 var groupedRows = from myTable in table.AsEnumerable() group myTable by new ...

Application.ThreadException for ALL exception? Not just un-trapped ones?

I'm trying to create a top level exception capture for a debug version of some real-time data capture software and was wondering if there was a top-level exception handler similar to Application.ThreadException that captures ALL exceptions, not just unhandled/trapped ones. Thanks in advance ...