.net

Number of Web services/proxy in a smart client applicaiton

Hi, I am working on a smart client application and it's using XML web services. There are so many work list in this application and the data objects are associated each work list. We can create a web service for each work list OR We can have a single web service to serve all work lists. Which one is the best approach in terms of perform...

Best way to use StructureMap to implement Strategy pattern

My web app has some slight variations in business logic and presentation logic depending on the type of user that is logged in. It seems like getting variations by injecting different concrete classes based on the user type is a good fit for DI. So I'm wondering what features of StructureMap I should use to achieve this (or if I'm way of...

How can I connect an object that requires a writable stream to an object that wants a Readable stream?

A DataSet knows how to serialize to a stream via WriteXml(). I have an object that wants a readable stream. How can I connect the DataSet to this other object? The plumbing analogy: suppose a 1/2" copper pipe has a "male" outlet, and a valve also has a "male" fitting. To connect the two I need an adapter - female on both ends. I...

Assembly binding under a WindowsImpersonationContext. How to prevent FileLoadException?

I have an application that needs to do a lot of impersonation, due to moving and creating many files across protected network shares. I've created a simple static class that has a method takes a user, domain, password and a delegate that contains code you need run under the impersonation context. The problem I've been running into is w...

Library for doc/xls to pdf/tiff conversion

I am looking for a library that will allow the following conversions: MS Word -> PDF or TIFF MS Excel -> PDF or TIFF PDF -> TIFF TIFF -> PDF I am using .net 3.5. I'll be using asp most likely, but this could end up being a winform app. The library does not have to be free. ...

Shifting the sign bit in .NET

I'm reading bits from a monochrome bitmap. I'm storing every 16 bits in a short in the reverse order. If the bit in the bitmap is black, store a 1. If white, store a 0. E.g.: for bitmap: bbbw bbbw bbbw wwww my short is: 0000 0111 0111 0111 The 1st way I tried to do this was: short m; // ... Color c = bmp.GetPixel(j, i); if (c.R == Col...

.Net form focus

I Have a .net form with multiple controls in it.. Textbox , labels ... When the form is shown on screen the textbox get the focus by default. When i try to scroll the form using mouse scroll wheel the scroll messages are basically going to Textbox and hence the form is not getting scrolled.. I tried setting textbox.capture = false fo...

Easiest way to signal an event to several processes in .NET

I was hoping there was an easy way to signal an event to several processes that did not involve me writing a custom socket listener. I'm trying to inform several applications that will need to update their cached configuration settings that a config change has occurred. I wanted to implement a "host wide" singleton, but have failed to fi...

any limit of SQL Server connection count?

Hello everyone, I am using SQL Server 2008 Enterprise + C# + ADO.Net + .Net 3.5. I am using sp_who2 or sys.dm_exec_connections to find active connections numbers (let me know if my method to find active connection numbers are wrong). For some heavy database consumer application, I can find even active connection count > 1000. I am wond...

Calculating load time on a ASP.NET page

Say, I want to calculate the time taken to load a ASP.NET page. When a user types the URL and presses enter, the following events take place: Request is sent to the server Server processes the request, executes any on load server side logic, makes DB calls Browser receives the response, downloads HTML and JS files Browser runs client s...

connection leak issue in SQL Server

Hello everyone, I am using SQL Server 2008 Enterprise + C# + ADO.Net + .Net 3.5. I am using connection pool at ADO.Net client side (the default behavior of ADO.Net). I am using sp_who2 or sys.dm_exec_connections to find active connections numbers (let me know if my method to find active connection numbers are wrong). If each time after...

wpf databinding - two way binding with a string?

I have a simple property on my view model that is of type string. I want to bind this to a textbox so that changing the textbox updates the string and changing the string updates the textbox. Do I REALLY have a write a wrapper class around the string type that implements INotifyPropertyChanged, or am I missing something incredibly simple...

WebClient upload file issue

Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 to develop a console application to upload a file to server. For the WebClient.UploadProgressChanged Event, I am wondering what is the rule when this event will be raised? I read the below document but find no accurate information (like will be raised 10 times during upload or somethi...

XAML Coding Guidelines

There is a plenty coding guidelines/standards available for c# language. However I couldn't find anything "official" regarding XAML. I'm particularly interested in naming conventions of the visual elements, but something about formatting would be also useful. At the moment my XAML files look like a big soup of tags, not really human read...

C# .net OCR library/components

What are the best paid for OCR libraries for .net c#? We are looking for something reasonable that is backed with good support. ...

Any WPF Gauge Controls that are open source?

I need to find an open source WPF Gauge Control that I can use in my Rich Client (not for silverlight). Does anyone have any recommendations on one that is open source? I need to build a WPF dashboard and the client is requesting using Gauges to display data. ...

How do i access the originating control for a ContextMenuStrip in C#?

I have attached a ContextMenuStrip to a TabControl and set up a handler for OnMouseDown that does the following: if (e.Button != MouseButtons.Right) { return; } for (var i = 0; i < tabControl1.TabCount; ++i) { var point = new Point(e.X, e.Y); if (tabControl1.GetTabRect(i).Contains(point)) { tabPageContextMenu.S...

DataGridView White Space After Last Column Header

I'm trying to mimic what every other tabular view does with the DataGridView control, but I can't seem to get the headers correct. I want a blank header to the right of all headers, that does not move, and is not actually a header. Is there a way to paint the default header along the top? Basically, this is my problem:HERE ...

How can I change what App.config gets renamed to?

I have an App.config file in my project that gets copied to NameOfExe.exe.config at build time. The users of my software will need to edit this file at times, but they may not be familiar with how .NET does things (or how computers do things in general). I think using a file name like that might confuse them, with the .exe.config extensi...

How to convert an XmlDocument to an array<byte>?

I constructed an XmlDocument and now I want to convert it to an array. How can this be done? Thanks, ...