.net

How can you get the coordinates of the "X" button in a window?

For one reason or another, I have a need to detect when the user actually clicked on the X button. What I have so far is this: protected override void WndProc(ref Message m) { if (m.Msg == (int)0xa1) //WM_NCLBUTTONDOWN { Point p = new Point((int)m.LParam); p = this.PointToClient(p); ...

IIS Webservice versus WCF Windows Service (.NET)

I have to fetch some data from a .NET application using another .NET application. I am wondering which are the pros and cons of each approach. In my case both solutions will work, but, as my service consumes much memory, I fear that IIS could multiply unnecessarly the instances increasing the memory load. Should I provide this service as...

Why doesn't this inherited view render?

I tried the following: I have a shared library (.dll) that contains these files: Views Search PowerSearch.aspx PowerSearch.aspx.cs PowerSearch.aspx.designer.cs The PowerSearch.aspx file contains my html code. The PowerSearch.aspx.cs file contains this: using System.Web.Mvc; using CommonProject.Web.Shared.Controllers; namespace...

linq to xml with C# and VS2008

XML Formatted <status> <webresponse> <properties> <props> <imghandle> <image handle=1234> <imagetag>somewhere</imagetag> </image> </imghandle> </props> <props> <imghandle> <image handle=1235> <imagetag>somewhere1</imagetag> </image> </imghandle> </props> </properties> </w...

Change views root folder

Is there a way to change the root folder for the views to the bin/views folder? ...

How to compare data of two tables transformed in SSIS package

Hi, A table has been ETLed to another table. My task is to verify the data between two tables programmatically. One of the difficulties I m facing rite now is: how to use the expression that I can get from, let s say, derived column task and verify with the source and destination. or in other words, how can I use the expression to wor...

Control vs UserControl in WinForms?

What is the difference between a Control and a UserControl in .NET WinForms? I want to create a custom control, but which one should I inherit from? I've always used Control in the past without any issues, but is the "recommended" way of creating a custom control? ...

Can I do this in .Net and WPF?

Hi, We have a third party app that has VBA integrated into it. This all allow us to open a vb6 activeX Dll that contains a UI and we pass the apps instance to the vb6 dll. ' Instantiate the SMTree UI. Set oSMTree = CreateObject("SMTree.clsMain") ' Start it up. oSMTree.cMain Application Then in the VB6 app the main looks like: Publi...

Efficient image manipulation in C#

I'm using the System.Drawing classes to generate thumbnails and watermarked images from user-uploaded photos. The users are also able to crop the images using jCrop after uploading the original. I've taken over this code from someone else, and am looking to simplify and optimize it (it's being used on a high-traffic website). The previo...

LINQ to MySql Data Provider

Hi, After a quick Google I couldn’t find anything too promising so I was wondering if anyone knew if there is a good/widely used LINQ to MySql Data Provider out there? ...

How can I force the focus outline to be drawn around the checkbox instead of the text on a checkbox control?

Normally, when tabbing through controls on a form, when the focus is set to a CheckBox control, the text is outlined to show focus. I am using a CheckBox without the text (so only the box is displayed). How can I force the focus outline to be drawn around the box instead of the text? ...

Clearing a Collection of Collections - clear every item first, or just clear all at once?

Suppose I have a Collection of some kind that itself contains Collections; e.g., Dictionary(Of String, List(Of MyClass)). If I want to clear the Collection entirely, does it make any sense to clear every individual child collection before clearing the parent collection, like so: For Each ListDef As KeyValuePair(Of String, List(Of MyClas...

"Dynamic" tables in SQL?

I am currently messing around with some stuff for an idea for a site - where I pretty much want to enable my users to create "Tables" which holds data and then allow them to query over this data (in a less geeky way than writing up SQL Queries and hopefully easier than using excel). My idea, so far, is to represent this in my database u...

Managed CPP reference paths?

I'm trying to compile a managed cpp application from the command line. Suppose my cpp application references the .NET 2.5 framework's "System.dll". I can compile like this, without problems: cl /clr /FU"System.dll" main.cpp The application then works as expected. If, however, I try to reference the .NET 3.5 framework's "System.core...

Hide Textbox Targeted by the ColorPickerExtender

Is there a way to hide the textbox that is targeted by the colorpickerextender in the newest release of the ajax control toolkit? If you add style="display:none" to the textbox, then the color picker shows up in the top left corner of the browser window. I want it to show up near the button that is referenced in the extenders popupbutto...

Which ORM will give me compile-tested queries?

Which ORM will give me compile-tested queries? Is linqtosql compile time tested? Edit: Say I write a query that references a column named 'TotalSales'. I then rename the column in my database to TotalSales2 (and any other config file like: Employee.cfg.xml in nHibernate). When I compile the project, I want Visual Studio to tell me ...

Is the Entity Framework out yet?

Since LinqToSql has been replaced by the Entity Framework, is the Entity Framework out yet? ...

how to use variables inside a delegate function

I'm using a SDK for a usb camera. The SDK specifies that for each frame grabbed, a callback function will be called. The callback function is defined inside the SDK, it gets a data pointer to the image and a structure used to interpret the data. All of that works correctly. To make a useful application out of that, I need to access a f...

User scope app settings always reset to defaults.

I have a WinForms app that uses the Settings feature of .NET 2, but the User scope settings values saved in the application often get replaced by the default values stored in the Settings class. Long ago I found guidance somewhere that attributed this to an auto-incrementing build number, and I suspect this is true. However, said guida...

Caching in WCF

I am building a WCF service, I need to store reference data in cache which i will look up every time i receive input from the method... What is the right way to do this? (I would also like to define a expiration policy for the cache that will invalidate it after a certain time interval) ...