.net

Can you get UpdatePanel working with RichDataControls?

is it possible? say with the listview? ...

Shared objects and multithreading issues. Should I care ?

I have a windows service hosting several WCF services. In my windows service I have couple objects with singleton behavior. This objects are accessible thru the WCF services from outside. A call can put a value into the objects and another call can retrieve this value. Should I care about multithreading issues? I'm not starting any thre...

script sharp gadgets in 0.5.5.0

Hi, I just created a new project with Script Sharp 0.5.5.0 VS2010 template for the sidebar and it did not even compile. It fails saying Application.Current.Run is not valid anymore. (Method Run doesn't exists) What would be the recommended solution? ...

How do closures work behind the scenes? (C#)

I feel I have a pretty decent understanding of closures, how to use them, and when they can be useful. But what I don't understand is how they actually work behind the scenes in memory. Some example code: public Action Counter() { int count = 0; Action counter = () => { count++; }; return counter; } Norm...

How do I limit the length of characters in a textbox in MVC?

I would like to limit a textbox to 10 characters in MVC. <label ID="lbl2" runat="server" Width="20px"></label> <%=Html.TextBox("polNum") %> <label ID="lbl1" runat="server" Width="10px"></label> I know you can set the Max Length property in .net. How do I do that in MVC with a textbox generated this way? ...

Why is the size of .NET Framework 4.0 installer smaller than 3.0/3.5?

As I can see, beta2 of .Net Framework 4.0 installation program is only 55MB, and it was 200+MB for .Net 3.5, What's happening? ...

Rich Client A / B Testing in .NET

Has anyone done much A/B testing with a rich client (i.e. WinForms or WPF) application? I am interested in deployment strategies that make sense for this scenario. It seems like ClickOnce deployment would be a good fit, but there's so much baggage with getting ClickOnce to work properly for a non-trivial application. If using ClickO...

.net Button fired only once

Okay, here is my problem: I have a form that requires to have two fieldsets that are almost identical but that collect different sets of data. These are contained in an UpdatePanel. The user enters the data in a form, and when they hit the "Add" button, this row is inserted into DataTable. The user should be able to enter as many rows ...

Programmatically create MS SQL Compact database file on a desktop

Hello Is it possible to create an SDF database file for MS SQL Server Compact on a desktop.? I want to craete a desktop application which can create an SDF database file for copying it to a Windows Mobile device. Is it possible and how? thanks ...

Compilation error - ICE80: The 64BitComponent ... uses 32BitDirectory ...

The following line Generates the following error: Error 4 ICE80: This 64BitComponent GlobalScopePackages uses 32BitDirectory blablabla c:\development\...\file.wxs Error is described on this page http://msdn.microsoft.com/en-us/library/aa369034%28VS.85%29.aspx How do I fix this or suppress the warning? Is it safe to simply supres...

How can I check if SQL server is alive?

I have a method to check and make sure my SQL server is online, which I use in some connection sensitive parts of my code. Although it works fine, I notice it takes upto 20ms to run, and I was wondering if anyone knows of a better way of checking SQL server to ensure its up and kicking. Here is my existing code. [System.Diagnostics.Co...

Link two controls in one

Hello, guys! I wonder if there is a possibility to (visually and functionally) link two controls(components)? (.NET2) Simplifying the things, I have two labels - one of them is the main label (it can be deplaced with the mouse) and an other - the description label - it needs to follow the main label on a specified distance. Also, the...

How can I have my auto-updater replace program files?

We have developed a program which checks our web site to see whether or not a new version is available. When a new version is available, a download program starts and retrieves the files, then copies that whole folder on top of the source and restarts the program with the new version. The problem is that when we run the program that se...

.NET - how to make a class such that only one other specific class can instantiate it?

I'd like to have the following setup: class Descriptor { public string Name { get; private set; } public IList<Parameter> Parameters { get; private set; } // Set to ReadOnlyCollection private Descrtiptor() { } public Descriptor GetByName(string Name) { // Magic here, caching, loading, parsing, etc. } } class Parameter ...

Inserting lines of pixels into an image quickly

My current dilemma is as follows: I have a 2550x3300 tiff. At certain (variable) points in my tiff I need to insert a line of pixels from elsewhere in the tiff. e.g. I need to insert 12 copies in a row of line 100 between lines 500 and 501. I've been looking up different image processing techniques for a few days now and can't find any...

Why does this cause a StackOverFlow error?

This is causing a StackOverFlow error and I have an idea why, but I would like a little more detail on why and is my solution for it the way it should be handled. Ok, first things first, the following code causes a StackOverFlow error when I try to assign a value to the property: private List<Albums> albums { get { if (...

What is ServicePointManager.FindServicePoint used for?

Can someone explain what ServicePointManager.FindServicePoint is intended to be used for? I have been writing some code to work with proxies in C#, and have seen indicators that it might be useful in this respect, but can't see why or how. How is this class (ServicePointManager) or method (ServicePointManager.FindServicePoint) supposed...

POSTing to a re-written URL on IIS 6 doesn't work

I am working on a site which is programmed in C# .net. It uses a CMS called ADX Studio (a decision which predates my time there) which provides a shonky form of URL Rewriting (as far as I can tell it works by assigning an aspx page as the default 404 handler in IIS). I have an web form which lives at a rewritten URL. I edited it so that...

WCF Service - Coding Standard - Where to put my class library?

Hi, I'm trying to implement a WCF Service in my program , howevery I don't understand something: According to the book "Programming WCF Services" , Juval Löwy 2007 O'Reilly Media,. Appendix C. - WCF Coding Standard C2 - Essential : 1. Place service code in a class library and not in any hosting EXE. I don't understand this, where sh...

Using var outside of a method

I wanted to use the var keyword to declare a field in my class however var only seems to work inside methods. The code I have looks like: public static Dictionary<string, string> CommandList = new Dictionary<string, string>{}; and I wanted to have: public static var CommandList = new Dictionary<string, string> How come this isn't ...