.net

some conceptual doubt on threading

i need to calculte the time taken to execute each thread.. so i used this code to do it. Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds,ts.Milliseconds); Console.WriteLine(ela...

numeric-only textbox as a control in Visual Studio toolbox

I would like to make one numeric-only textbox. I'd like to then add that same to the control toolbox within Visual Studio 2008 I've already built the function to allow only numeric. How can I make it available in the toolbox? ...

ICollection cast problem

Hi! Is there any solution to solve the problem with this cast example? I need to add a new element to the collection, so I have to solve it. IEnumerable enumerable; IEnumerable enumerable2; enumerable = new ObservableCollection<Something>(); enumerable2 = new ObservableCollection<Object>(); ICollection<Object>...

Protected Internal properties vs Protected properties and Resharper

I've just picked up Resharper and have been playing around converting fields to properties. I want these properties to be protected, but Resharper doesn't want to give me that option. Instead there is only a Protected Internal option. This has me thinking. Either there is a rule somewhere that properties should always be 'protected inter...

svn server on shared hosting

I m looking for an open source svn server which I can install from web. (like wordpress installation) Because of shared hosting. I will connect svn server from with visual studio.net. ...

Application.StartupPath pointing to strange MS Directory.

Hello again guys, strange error. One of which i cannot find any existing resources to solve the issue. The issue is, when using Application.StartupPath I get pointed to a folder at "C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0". Naturally, this breaks everything which depends on the correct folder (the one my so...

capturing the name of a missing field in the datasource of a webcontrol

When I get this error "Missing field or property x in the selected datasource", I want to capture the error and display the "x". How do I do it? Note: the error message is translated from spanish, so I actually dont know how it's exactly in english. The original error in spanish is described as "No se encontró ningún campo o propiedad...

DropDown Menu with ScrollBar in .NET

Hi,I'm trying to make a user control similar to the Windows Vista/7 breadcrumb bar used in windows explorer. However, when I show the drop down menu for a breadcrumb with many sub items, I get a very long list that sometimes exceeds the screen size. In the Windows Vista/7 example however, there are a maximum of 18 items displayed at a t...

What's the difference between the timeout property specified in the Web.Config and the ExpiryDate property of the FormsAuthenticationTicket?

In the Web.Config we have a timeout property. Ex: <authentication mode="Forms"> <forms loginUrl="~/Login.aspx" timeout="2880"/> </authentication> When loggin in, we can specify a ticket expiry date. Ex: FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( 1, id.ToString(), DateTime.Now, exp...

A reportviewer control bug to display unicode?

Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 + ASP.Net + IIS 7.0 with reportviewer control. The report created by reportviewer control is very simple, just a single line of Chinese characters (I wrote the line of characters statically in a textbox control, no addtional dynamically generating or fetching from database). I upload...

Problem with SharpPCap

I get BSOD almost every time I abort the thread or close the device. Somebody with the same issues? EDIT: I saw that it happens on the N-th time I close my app, even if I don't close the devices. ...

Can I achieve exactly the same user experience with ASP.NET MVC as with ASP.NET (Webforms)?

Possible Duplicate: Can I use ASP.NET MVC together with regular ASP.NET Web forms Let's say I need to build a shopping cart. Would I be able to get the same user experience with ASP.NET MVC or would I need to "pick the right tool for the job" - use Webforms and MVC where applicable instead of just focusing on either one. ...

Exception occured While loading dynamically EXE assembly in C++/CLI (Could not load file or assembly ', Version=1.0.3836.39802 ...)

Hello, I am facing an exception in C++/CLI while dynamically loading assembly which itself an EXE created in C++/CLI managed mode using Assembly.Load. It successfully loads a dll assembly, but fails to load EXE assembly and generates following exception: An unhandled exception of type 'System.IO.FileLoadException' occurred in TestManag...

Regex: Repeated capturing groups

I have to parse some tables from an ASCII text file. Here's a partial sample: QSMDRYCELL 11.00 11.10 11.00 11.00 -.90 11 11000 1.212 RECKITTBEN 192.50 209.00 192.50 201.80 5.21 34 2850 5.707 RUPALIINS 150.00 159.00 150.00 156.25 6.29 4 80 .125 SALAMCRST 164.00 164...

Using Where to specify different generics.

I'm writing a bijective dictionary class, but I want to ensure the two generic types are not the same type for two reasons. Firstly, I would like it to implement the IDictionary interface in both directions, but public class BijectiveDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IDictionary<TValue, TKey> gives me " 'Bije...

How do I enable DEP or ASLR for my .NET application?

I'm writing my program in VS2010 and the build target is .NET 4. I believe that the DEP compatibility flag is on by default. Is that true? Is .NET also compatible by default with ASLR, and is ASLR turned on by default for my process, or do I have to request it at runtime? ...

LINQ to SQL. Cascade delete sumulation

I have many-to-many relation between persons and addresses Person { Id, ... } Address { Id, ... } Address2Person { Id, PersonId, AddressId } DBML-generated classes looks like (there are PK and FK on diagram): class Person { Id, Address2Person } class Address2Person { Id, Person, PersonId, Address, AddressId } class Address { ...

How do I check the .NET version of an App?

Other than running it on a computer that only has .NET Framework Version 3.5, how do I check what version a .NET app is? ...

PHP5 COM(), DOTNET(): how to start?

Where I'm stuck is the right parameter syntax to instantiate an object using PHP's com() and dotnet() classes to load .net assemblies, windows system applications and components beyond the usual MS Office apps. If successfully created, working with the objects isn't an issue here. Can anyone explain what each part of each parameter mea...

Whats the best feature of the ORM framework you use

Hi all, I'm wondering what the best feature(s) of the orm framework you use and what features you find yourself using most? What is the reason you chose the framework you use? I'm just trying to compare them and wondered if any offers advantages over the other. (it's all very well googling this but you can't beat first hand user exper...