.net

.NET DateTime not returning AM/PM in ToShortTimeString()

I've run into a problem that's driving me crazy. In my application (ASP.NET MVC2 /.NET4), I simply running this: DateTime.Now.ToShortTimeString() All the examples I've seen indicate I should get something like: 12:32 PM, however I'm getting 12:32 without the AM/PM. I launched LinqPad 4 to see if I could replicate this. Instead, it re...

Process spawned through Process.Start in .NET hangs the thread

Our application has a background thread which spawns a process through System.Diagnostics.Process: Process.Start( new ProcessStartInfo { FileName = url, UseShellExecute = true } ); This used to have no issues at all. But now, the background thread is silently dying; it never returns from the call to Proces...

ObjectDisposedException when I abort a thread that's writing to the serial port

I've written an application with a plug-in feature, and if a plug in doesn't respond quickly to a stop request, I call Thread.Abort() on its worker thread. This seems to work most of the time, but I recently discovered that it throws an ObjectDisposedException if the thread is aborted while it's writing to the serial port. With some USB-...

Why we need events for callback?

We can call callback methods using delegates. For eg, public delegate bool ContinueProcessing(); // later in code we can write , ContinueProcessing cp = new ContinueProcessing(IsDataAvailable); cp += new ContinueProcessing(IsTransactionComplete); //later in code defination of methods bool IsDataAvailable() { return true; } bool I...

Building of your Domain Objects?

I'm in the process of trying to learn Domain Driven design so i'm sure this will be the first of many questions (i can already think of at least a couple more but i don't want to fragment my questions). I'm using Dino Esposito's "Architecting Microsoft .NET Solutions for the Enterprise" which, in some cases, is very abstract. First o...

.Net Full qualified name for variable type

Where I work, I often see code like that : public void Test(Models.User.UserInfo userInfo, Models.User.UserParameter param) { ... } Personally, I prefer to see something like that : public void Test(UserInfo userInfo, UserParameter param) { ... } And have an import at top. What you think about this ? What the best practices ? W...

Is there an open-source Chord DHT implementation for .NET?

I'm looking for a high level, decentralized, robust, scalable lookup/message passing package I can use with .NET 2.0. I believe Chord is the correct base algorithm for this use. Explicit, proven time guarantees are a must (e.g. lookups resolve in at most log(n) messages or steps). Chord routing looks sufficient. Suppose I want to prov...

Entity Framework 4 exception not being thrown / caught

I am connecting to a MySQL database from Visual Studio 2010 using Net/Connector. This is the entity framework 4 linq query: int timeThreshold = 5; DateTime cutoffTime = DateTime.Now.AddMinutes(-timeThreshold); try { using (var context = new myEntities()) { var un...

asp.net mvc postback

Hi, I am using ASP.NET MVC application. However I am not able to understand the fact that in ASP.NET MVC pages are not posted/no postbacks. How is that possible? Unless posting the data how can the MVC framework manipulate the posted data. So what is the point in telling ASP.NET MVC does not have post backs. And also what the REST princi...

ANNs in Matlab and FANN

How can I get a neural net file from Matlab into a FANN .net file ...

Which .NET Managed classes to initiate internet connection?

Are there any .net classes that allow for controlling an internet connection? Such as connecting/disconnecting from a wireless connection? Any details need to be useable in any .net framework version running on XP sp/3 or later windows OS. ...

Customized UI - Windows or Linux?

I'm not sure if this is possible, but I'll give it a go. I'm creating a device where I have to add a customized user-interface instead of the normal operating system UI. I'm thinking of installing Windows CE (or .NET MICRO) or Linux, but I'm not sure which OS would let me do this. Also, the software (UI) would load instantly and doesn't...

WPF custom style, pass binding parameter

Hi all! I have such style in WPF <Style x:Key="SubTabItem" TargetType="{x:Type TabItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TabItem}"> <ControlTemplate.Triggers> <DataTrigger Binding="{Binding Path=IsSelected}...

Increase Performance of DevEx WPF Grid

I'm using the DevEx DXGrid (WPF) to show about 2,000 rows of data. I'm using a DataRow Template to get Master-Detail behavior (a new detail grid for each row). My application responds extremely slow to almost all use input (to the grid). for example: scrolling expand/collapse group rows resize app window I've contacted DevEx suppo...

Determine which objects in ASP.NET are used in session

I have inherited a very large ASP.NET app that needs to be modified to use a State Server instead of in-proc sessions. I need to track down all classes used in session throughout the app and then determine if they can be serialized. Are there any tools that can be used to analyze the code to determine the classes used in session? ...

How to split for only one string without using arrays

I've a string 01-India. I want to split on '-' and get only the code 01. How can I do this. I'm a .net newbie. Split function returns a array. Since I need only one string, how can this be done. Is there a ingenious way to do it using split only. Or do I've to use substring only? ...

how to create a help file in .net?

Hi, I want to create one help file for my whole application. and once user press help button next to any input control then appropriate help topic from file should get display. how can i create this functionality in vb.net? ...

How can I set the overridedefaultbutton to tab in asp.net?

How can I set the overridedefaultbutton to Tab so that pressing Enter tabs to the next input field, and doesn't cause a postback? ...

User-initiated action implementation

In Flash 10 there are methods that require that they are triggered from user-initiated actions like button click, keyboard up/down keys, etc. Is it possible to implement this behaviour in .NET? For example, if we have this subroutine: void SomeMethod() { // Here some stuff } how to check inside it whether the method was called fro...

href to return nothing?

Hi, I have a user control in the modules folder of my project. and I have a link like Test in this control. When ever I mouseover this "Test" on the page, I can see the whole url like this "www.example.com\projectName\Modules". But I want to make it such a way that it should display the url as "www.example.com\projectName". I want to g...