.net

Strange behavior in FormBorderStyle between Fixed and Sizable

I have created a simple test form with FormBorderStyle = FixedToolWindow by default and added a button that will switch between FixedToolWindow and SizableToolWindow on mouse press. Switching the FormBorderStyle between these two seems to produce a weird effect that's causing a lot of issues on my application. The problem is that the wi...

What is the known performance difference between a Microsoft.VisualBasic.Collection and a .NET System.Collections.Generic.Dictionary(Of TKey, TValue)?

I'm working on a fairly large project for a trading company in Philadelphia. The company utilizes automated trading algorithms which process streaming quotes and send out quotes for hundreds of products dozens of times per second. Obviously, performance is a significant concern. (Which makes me question why we're using VB.NET, but that's...

How to display a SQL Reporting Service report in Excel

Hi everyone, At the moment i am using VSTO to take a SQL Reporting Services report and display it in Excel 2003 using the ReportViewer control. So bascially on a winform hosted inside Excel. But i also need to be able to display it without the ReportViewer control i.e. just straight into the cells of my Excel sheet. I'm wonder how I s...

WPF ListBox Selection Problem when changing an item

When changing the selected item in a ListBox, I'm getting a weird error where the changed item appears selected but I cannot deselect it or reselect it. Is there a way to fix this? Here's a sample app that demonstrates the problem. public partial class Window1 : Window { public Window1() { InitializeComponent(); ...

WCF webservice stop working after upgrade to framework 3.5 sp1

I have a wcf webservice on one of my testing servers. Everything worked fine until I upgraded frome framework 3.5 to 3.5 sp1. the wcf web service stoped working and returns the error: "Failed to invoke the service. The service may be offline or inaccessible. Refer to the stack trace for details." "The remote server returne...

MVP pattern, how many views to a presenter?

We are trying to get the Model-View-Presenter pattern used on (virtually) all new dev work that we undertake. I'm a strong believer in having a framework to help people meet a design requirement, we have a few in-house frameworks for various different components (logging, email sending, etc), so I'm trying to get some kind of MVP framew...

Is there a tool where you can edit a .NET dll directly?

Is there a tool where you can edit a .NET dll directly? .net reflector allows you to view the dll but doesn't allow you to modify it directly. ...

VSTO write to a cell in Excel!

Why does this work: ((Excel.Worksheet)Application.ActiveSheet).get_Range("A1", "A1").Value2 = text; But this doesn't: Excel.Worksheet activeSheet = ((Excel.Worksheet)Application.ActiveSheet); activeSheet.Cells[0, 0] = text; I need to do it the second way as I need to loop with rowIndex and colIndex. How can I do that? I get the er...

.NET WPF Process.Start() not working on Vista and Windows 2007

Hello, I have WPF application. After testing my app on Windows7 and realized that opening help does not work. Basically to open chm help file I call: Process.Start("help.chm"); And nothing happens. I have also tried my app on Vista SP1, same result. I'm admin in both OS'es I have googled this problem, but have not found solution ...

Efficiency of transaction in code vs. DB

What is more efficient -- having a IDbTransaction in the .net code or handling it in the database? Why? What are the possible scenarios in which either should be used? ...

Delegates and Events in Interface?

Can we implement delegates and events in Interface? ...

Overloading,Overriding and Hiding?

Hi, can anyone explain what is Overloading, Overriding and Hiding in .Net? Thanks ...

Optimize NHibernate Query

Hi In my system I do a centralized calculation on an aggregate with a lot of collections. I need ALL of the collections to be loaded before the calculation, and therefore I use a multicriteria that joins the collections on the root. The criteria i listed here below. It takes approx 500ms to run on my local setup, and that is a lot of ...

String.Format Vs. String.Concat - Performance Comparision

String.Format Vs. String.Concat both are used to crate string. Which one is faster? Any body have any idea? ...

How do I write events and eventhandlers in C#?

I've been trying a good way to memorize how to write events and eventhandlers in C# for a while. Whenever I want to refer to a tutorial on the Internet they tend to be verbose. The question is how do I write events and eventhandlers in C#? Have you got a code example that illustrates easily how to write such? ...

1 or more bytes truncation with GZip round trip [solved]

Hi I dont get it. I have used a similar/same approach for many years now, and never experienced this. For some reason, that I did not pick up until today, a GZip round trip results in 1 or more bytes being truncated or data being garbled. I wrote a simple test to verify that something else is not affecting it. This always fails with ...

Directory.GetFiles() gives weird return values

This problem occurs when I try to hide a file in my directory with a tool named File Lock. This is not a regular hide as I can not see it in windows explorer. Code: string[] textFiles = Directory.GetFiles(@"c:\mydir") //0 files returned string[] textFiles = Directory.GetFiles(@"c:\mydir", "*.txt") //1 file returned: "c:\mydir\." File....

How will using Code Contracts in my web project affect deployment?

If code contracts are used in an application then do we need to install anything (from Code Contracts package) on production server like putting assemblies into GAC or running code contracts installation package on production server? Or just putting libraries in bin folder will work? ...

HttpWebRequest to URL with dot at the end

Hi, when i do a GET with WebRequest.Create("http://abc/test.") i get 404 because according to fiddler the trailing dot gets stripped away by .NET and the web server needs the dot. how can i prevent that or work around it. any workaround is appreciated! ...

Using Hashtables/Dictionaries with string keys & Case Insensitive Searching

Wondering if this is possible. We have an 3rd Party library that contains identification information about users... The main interaction with the library is through a HashTable which is keyed with a string, and returns an Object Graph of information for that key. The problem is, the key is obviously Case Sensitive, but what we get fro...