.net

Visual Studio "Any CPU" target

I have some confusion related to the .NET platform build options in VS 2008 Does anyone have a clear understanding what does "Any CPU" compilation target is and what sort of files it generates? I examined the output executable of this "Any CPU" build and found that they are (who would not see that coming!) the x86 executables. So, is th...

Getting current GMT time in C# (.Net)

Is there a method in C#(.Net) that returns the UTC(GMT) time zone??? (Not based on the system's time). Basically I want to get the correct UTC time even if my system time is not right ...

Ensure latest version with clickonce deployment

How could I ensure that all the clients will always be using the latest version of a winforms application (updates from a network place, suppose always connected) while deploying it with clickonce. Thanks. ...

How do you parse an HTML in vb.net

I would like to know if there is a simple way to parse HTML in vb.net. I know that HTML is not sctrict subset of XML, but it would be nice if it could be treated that way. Is there anything out there that would let me parse HTML in an XML-like way in VB.net? ...

How do I get a reference to the underlying object in a bound DataGridViewComboBoxCell?

I don't know if my mind is not working today or if this is actually harder than I think it should be. I've got a DataGridView with a DataGridViewComboBoxColumn bound to a generic IList of CustomObjects. Here's a rough code sample of how I setup the column. DataGridViewComboBoxColumn location = new DataGridViewComboBoxColumn() { N...

Problem attaching an entity in LINQ to SQL

Hi, I'm trying to attach an entity in LINQ to SQL but it throws the following exceptionL: An attempt has been made to Attach or Add an entity that is not new, perhaps having been loaded from another DataContext. This is not supported. <Table Name="dbo.Products" Member="Products"> <Type Name="Product"> <Column Name="Id" Type...

Updating system time in Visual Studio using .net(C#)

How can I update the system time using Visual Studio with C#(.Net)?? ...

What features do you wish were part of C#?

... and things that you still look forward to seeing in the upcoming versions. ...

How to modify webservice proxy to get Raw XML

Here's the proxy method that was created for the web service I'm trying to access. How would I go about modifying it to get the raw XML from the web service call? /// <remarks/> [System.Web.Services.Protocols.SoapHeaderAttribute("CallOptionsValue")] [System.Web.Services.Protocols.SoapHeaderAttribute("MruHeaderValue")] ...

How to reference a namespace from a specific assembly?

So here is my problem. My (test) project references both Castle Windsor and Rhino Mocks. I am creating a class which implements Castle.Core.Interceptor.IInterceptor from the Castle.Core.dll assembly In building Rhino Mocks, Ayende used Castle.Core.Interceptor and includes the whole darn namespace inside the Rhino.Mocks.dll So when I...

updating system time in Visual Studio using C#(.Net)

I have a web service running that is returning a time. I want to update my system's time with the time that my service is returning . How can I do this in visual studio using C#? Edit: Exact duplicate of: http://stackoverflow.com/questions/204936/set-time-programmatically-using-c ...

jvm design decision

Why does the jvm require around 10 MB of memory for a simple hello world but the clr doesn't. What is the trade-off here, i.e. what does the jvm gain by doing this? Let me clarify a bit because I'm not conveying the question that is in my head. There is clearly an architectural difference between the jvm and clr runtimes. The jvm has a ...

Select Primary Key

[UPDATE: MS SQL Server 2005] Hi is it possible to select a bunch of values, and then assign a column in the select statement as the primary key? SELECT ID FROM HQ AS PRIMARYKEY -- this is wrong SELECT Names FROM Stores SELECT PRODUCTNAME FROM PRODUCTS I ask this because I want to take advantage of the DataRow find method in .net, tha...

Is it worth using 3-tier architecture for small(ish) applications

I'm working on a relatively small asp.net web application and am wondering if there is really a need to employ full n-tier architecture. For an idea of size; there are about 20 database tables. In the past I have used a 2-tier approach where business logic and data access are grouped together into a single class library with was an asp...

When NOT to use the Entity Framework

I have been playing around with the EF to see what it can handle. Also many articles and posts explain the various scenarios in which the EF can be used, however if miss the "con" side somehow. Now my question is, in what kind of scenarios should I stay away from the Entity Framework ? If you have some experience in this field, tell me ...

Query ManagementScope object to find out Cache size in ASP.NET

I'm wanting to programmatically monitor the cache size on a certain ASP.NET site. This is basically for the administration portion of a product, where we allow users to partially control whether their site uses caching or not. Is there a way to do this. Should I be using the ManagementScope object to perform this query? ...

Difference between firstmatchcodegroup and unioncodegroup?

What is the difference between these a unioncodegroup and firstmatchcodegroup? I have this question in an exam paper: Ensure that all loaded assemblies default to the nothing permission set. Also ensure that when an asembly with comes from a trusted zone, you grant it a full permission set. The answer is: PermissionSet ps = new Permi...

How is the Parent property of a FrameworkElement set in Silverlight?

I have written a custom Silverlight control based on Control. I have two DependencyProperties called Top and Bottom which both hold child controls for a specific layout display. I then use a ControlTemplate to arrange these two controls into a grid, placing one on the 0 row and the other on the 1 row. The problem I have is that I cann...

Mature and Robust .NET Class to allow/disallow XHTML tags/attributes

I need an extensible class to parse a string and allow certain XHTML tags and attributes. If the given string contains invalid tags, they shall simply be encoded to display on the page as entered. I need to be assured that no user input will be lost. Thank you! ...

Comparing scalable web-app architecture on Java and .NET

What are the recommended steps for creating scalable web/enterprise applications in Java and .NET? I'm more interested in what it takes to go from a low volume app to a high volume one (assuming no major faults in the original architecture). For example, what are the options in each platform for clustering, load-balancing, session manage...