.net

new .net floating point types for x64?

Hello! Does anybody know if there are any? I would be interested in a .net floating point type with the range of a double (or greater) combined with the precision of a decimal (or greater). Are there any planned? Anybody interested in speculating as to the usefulness or practicality of a new high-precision, high-range floating point typ...

Why does my partial mock have all virtual methods mocked, even if no expectations are set?

I have a user control which does some validation in the ValidateChildren method which I would like to test. I have created a partial mock of the user control, but although I am not setting any expectations on the ValidateChildren method, I am simply calling it, it is simply skipped and the code inside the method never executes. To try ...

Getting U+fffd/65533 instead of special character from Query String

Hi, I have a C# .net web project that have a globalization tag set to: <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="nb-no" uiCulture="no"/> When this URL a Flash application (you get the same problem when you enter the URL manually in a browser): c_product_search.aspx?search=kjøkken (alternatively: c_prod...

Is there a way to get the difference between two sets of objects in c#

I want to get the difference between two sets of ints in c#. Given s1 and s2 I want to return those ints which are in s1 and not in s2. I can do something such as: List<int> s1 = new List<int>(); List<int> s2 = new List<int>(); foreach (int i in s1) { if (s1.Contains(i)) { // } ...

Import textfile with weird format in C#

I have this exported file of some weird (standard for this industry!) format, which I need to import into our Database. The file basically looks like this: DATRKAKT-START KAKT_LKZ "D" KAKT_DAT_STAMM "1042665" DATRKAIB-START KAIB_AZ "18831025" KAIB_STATUS_FM 2 KAIB_KZ_WAE "E" DATRKAIB-END DATRKARP-START K...

Sorting tuples in F#

I have a list of tuples representing coordinates of points. How can I sort them by the first or second value, so that I could order my points from left to right first and from top to bottom next? ...

UserControl events in webform

Hello I have an usercontrol which contains 3 buttons and 7 text boxes.I am calling that usercontrol dynamiclly in my webform using LoadControl. But my problem here is 1.How to know which button(of user control) was clicked on my page? 2.How to raise those events? Thanks Kavitha ...

How to change the loading path of references in .NET?

I want a setup like this: +- /ApplicationFolder -- App.exe -- Core.dll -- AnotherShared.dll +- /PluginsFolder -- plugin1.dll -- plugin2.dll But because plugin1.dll references to Core.dll and Shared.dll when I compile the application it drops a copy of "Copy.dll" and "Shared.dll" to plugins folder as well and if I remov...

C# How to show a text bubble on a user control?

I'm developing an user control in .NET 3.5. As reaction to some event, I would like to show a simple bubble containing a short text on this control, similar to the well-known system tray notification bubbles. I'm sure this is a very easy task, could you give me a quick hint? ...

MySQL & .NET: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.

I wanted to use SubSonic as it said it would be easy to use and a time saver. After 3 hours trying to get the connection string for MySQL right I'm about to give up on it. Building configuration from C:\Documents and Settings\user\My Documents\Visual Studio 2 008\Projects\ConfigurationItems\ConfigurationItemsMVC\Web.config Adding conn...

What breaks a .net binary (dll) interface

Consider two .net dlls. The first, "application.dll" contains the main business logic and data access code. The second, "webservice.dll" consists mostly of WebMethods that link to objects and methods with application.dll for the purpose of providing webservice calls to existing code. What changes (e.g. add new classes, add a new field o...

Loading HTML fragments asynchronous in a web page that is generated using XSLT & XML

Technology: Dot Net, ASP.Net We have articles stored in XML repository and article contains multiple sections. These XML files are transformed to HTML using XSLT for browser rendering. New requirement is to allow users to comment on each section (not on the article!) and when the article is shown we also show the comments (but based h...

Generic GDI+ error with ThreadExceptionDialog in stack trace

We received some hard to reproduce error reports. The users gets the "An error occurred. The application will now exit." message box and then the app exits. In Main() I write the exception to a log file: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.FromHbitmap(IntPtr hbitma...

Design a client layer over a set of web services

In a rather large .Net application I have a web services layer that I use both as an external API and also in my own web pages. I am thinking about implementing another layer, a client layer that will communicate with the services and to use these client objects in my pages. Since each web services corresponds roughly to a functionality ...

How can I stop using a mouse while programming in my IDE?

I love using an IDE, because I get some great productivity gains. However, I have a couple reasons to stop using a mouse with an IDE: To code faster - It definitely slows down my coding when my typing is interrupted with all of the constant point and clicking. To relieve pain - I've never had pain from the keyboard, but I get tendinit...

WPF - How can I center all items in a WrapPanel?

I'm using a WrapPanel as the ItemsPanel of an ItemsControl. Right now, the items in the control wrap like this: |1234567 | |890 | I'd like them to wrap like this: | 1234567 | | 890 | Conceptually, the layout process should align each line of items such that it's centered within the WrapPanel's bounds. Can someone explai...

What's new in IE8 regarding to WebBrowser Control?

What's new in IE8 regarding to WebBrowser Control via interfaces or direct API calls? Is there any new extensibility feature or a new API? ...

Is there a way to display less than 4 numbers in the assembly version?

I need to display only 3 numbers for my assembly versions, to comply with our internal guidelines I tried removing the last digit from the AssemblyInfo file to look like this [assembly: AssemblyVersion("0.5.0")] [assembly: AssemblyFileVersion("0.5.0")] And I display it like this Assembly.GetExecutingAssembly().GetName().Version.ToSt...

C#/.NET - WinForms - Instantiate a Form without showing it

I am changing the Visibility of a Form to false during the load event AND the form still shows itself. What is the right event to tie this.Visible = false; to? I'd like to instantiate the Form1 without showing it. using System; using System.Windows.Forms; namespace TestClient { public partial class Form1 : Form { public...

ComboBox bound to an enum type's values while also having a "blank" entry?

If I bind a WinForms ComboBox to an enum type's values, i.e. combo1.DropDownStyle = ComboBoxStyle.DropDownList; combo1.DataSource = Enum.GetValues(typeof(myEnumType)); Who knows how I could achieve the same result, while, in addition to entries matching each enum value, I can also have a blank entry representing no selection? I canno...