.net

C# winforms Picturebox, backgroundimage zoomed at the top?

I have a picturebox where I change the BackgroundImage frequently. I have a the BackgroundImageLayout set to Zoom. The problem is that when an image does not have the same scale as the picturebox, the picture is drawn in the middle. That is, the top and the bottom padding of the picturebox is always the same. I would like for the Bac...

Should I call Dispose() within a function after Return?

Should I call .Dispose() after returning an object that implements IDisposable? myDisposableObject Gimme() { //Code return disposableResult; disposableResult.Dispose(); } In other words, is the object I return a copy, or is it the object itself? Thanks :) ...

Paging in rdlc report viewer.

how to enable paging in rdlc report viewer in .net 2008? ...

In LINQPad can you access SYSOBJECTS using LINQ?

In LINQPad is there any way to access either the SYSOBJECTS table or the various INFORMATION_SCHEMA.xxx views using LINQ? I spend a lot of time searching through our huge company database for partial names as there are too many tables and Stored Procedures to remember the names of them all. I know I can enter and run SQL in LINQPad but...

Creating a REST client API using Reactive Extensions (Rx)

I'm trying to get my head around the right use cases for Reactive Extensions (Rx). The examples that keeps coming up are UI events (drag and drop, drawing), and suggestions that Rx is suitable for asynchronous applications/operations such as web service calls. I'm working on an application where I need to write a tiny client API for a R...

IIS7 dynamic content compression and webservices

I am moving and old asmx webservice to a new server with IIS7. This webservice basically sends a big dataset (10mb+) to a winform application. The old solution was implemented using a custom soap extension which compressed the content before sending the stream to the client. The client, of course, implemented the same custom soap extensi...

SOAP WCF Webservice behaves differently when called locally or remotely

I have a WCF SOAP 1.1 Webservice with the configuration specified below. A concurrent call to any method of this endpoint hangs until the other returns when called remotely (from another computer on the network). I cannot replicate this when these methods are called locally (with a client located on the same machine). I tried to incr...

ASP.Net wrapper control for JQuery datetime picker.

Hi, I'm looking to create a wrapper control for JQuery date time picker control to be used in asp.net website. Once the user control is ready, it will be used in simple web forms / grids / data lists or repeater controls. User control will also expose below mentioned properties for customization. TimeHourFormat: "12" or "24" (12 (AM/...

C# Drag drop does not work on windows 7

I have had a project for quite a while using C# winforms. I implemented a drag-drop function before windows 7 was release. Worked like a charm. However, when using windows 7 it does not work. The event doesn't even get triggered. AllowDrop is set to true. When subscribing to DragEnter it does not get called in windows 7 (not sure about ...

How does OfType<T>() Work?

How does OfType() Work? I read this link about what's going on but how exactly does the LINQ provider know how to get all objects matching the specified type. I know the IQueryable<T> "chains" up requests and then evaluates when GetEnumerator() is called (right?). Specifically I want to know how does the framework quickly do type comp...

XML deserializer (Iserialzable)

Hey everybody, I have a class in c# that implements Iserialzable. I'm using a XMLSerializer that produces a XML from instance of that class. I get the following XML: <?xml version="1.0"?> <Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <SessionConfiguration> ...

Detecting Completion of an Array of Threads

I have created an array of threads and started all of them. How to know whether all threads have completed work. I don't want to use thread.wait or thread.join. ...

How are developers using source control, I am trying to find the most efficient way to do source control in a small dev environment

I work in a group of 4 .Net developers. We rarely work on the same project at the same time but it does happen from time to time.We use TFS for source control. My most recent example is a project I just placed into production last night that included 2 WCF services and a web application front end. I worked out of a branch called "prod...

IConnectableObservables in Rx

Hi there Can someone explain the differences between an Observable and a ConnectableObservable? The Rx Extensions documentation is very sparse and I don't understand in what cases the ConnectableObservable is useful. This class is used in the Replay/Prune methods. ...

How to find windows service exe path

Hi, I have a windows service and I need to create directory to store some info. The directory path must be relative to the windows service exe file. How can get this exe file path ? ...

populate a combbox with attributes of a selected xmlnode using c#

Im using c#.net windows form application. I have a xml file. I have loaded unique node names into a tree view. Here is the xml file: Hello.xml - - abc hello how ru - def i m fine - ghi how abt u - asd aaaaaaaaa I have loaded the node names into a tree view. The code I have used is: string x...

Why the "Non" in "ExecuteNonQuery"?

I know this is not a hell of an useful question but I can't help being bugged by it. So, Why said method (in *Command classes) is called ExecuteNonQuery instead of ExecuteQuery? Aren't those SQL statements we throw at DBs, queries? ...

Is there a non-blocking version of MessageBox.Show (or something like it)?

Long-delayed update I'm accepting MUG4N's answer to this question, and I also want to respond to some of the criticisms that were raised against it. ChrisF said: ...you can't make UI calls directly from background threads. This is a blanket statement, and is not 100% true. Let me just point out a few facts: You can actually mak...

Resize Rectangle based on text

Hello, I am working on a custom control where I am using Rectangle to show some data. Now, lets say the width and height of the rectangle is set to 100. If I have less amount of data, then its fine, I can make it draw using DrawString method. But, sometimes Data is bigger and so it gets clipped. I have tried using MeasureString Method,...

Any suggestions on data syncronization from a server to a desktop?

I have a web based CRM system that stores all the client data from all the clients into one database (MS Sql Server). We need to build a system that maintains a local copy of the data for each client. So basically the client database will have all tables and columns except for the ClientId that is in ever server table. I am aware that I ...