.net

.Net application design

Hi, We are making an application with the details below. 1) Web/Desktop App on C#.Net 2) Stores users activity timestamp as a datetime field. We need to store this timestamp in UTC format. Now, while displaying it will be converted to user's timezone. Problem The user can float from one office to another. (multiple offices all in ...

What does it mean by Event ?

I have learned delegate in dotnet that is referencing any function. What does it mean by event coceptually? Is it any reference ? It has a middle layer and use delegates internally. But, what is that middle layer ? Actually, what can we do using event ? or Why should we use it ? Why does event has no return type ? Why is it public by ...

Calculate a vector from a point in a rectangle to edge based on angle

According to Daniel, in his answer, there is no easy way to modify the below function so I bit the bullet and started from scratch. Solution is below (as an answer). Actually, ignore my answer. See Tom Sirgedas' answer it's a lot shorter. I need to modify the solution found here: http://stackoverflow.com/questions/1343346/calculate-a...

What is the experience when moving to VS10?

We're thinking of upgrading a very large product to VS10. I've heard a lot of good things about VS10 and am very excited about the new C++0x features however when playing around with VS10 I had one case in which a sample toy application crashed (which it didn't in VS8) and one case in which there seems to be a compiler bug in some C++0x...

How to fix DataGridView RowHeader text wrapping problem?

I am trying to decrease the height of DataGridView rows to allow showing as much of theme. But all my best effort produces the following result: These are the settings used for the RowHeaderDefaultCellStyle: aGrid.RowHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight aGrid.RowHeadersDefaultCellStyle.BackColo...

.NET How to perform "sequential" thread utilization

I am using a multi-threaded producer/consumer queue with a single (very fast) producer and many, much slower, consumers. Each consumer has exclusive access to a piece of physical hardware, such as a phone line. The producer runs on the main thread and each consumer runs on its own thread. Each consumer thread is created and initialize...

.NET Structure Concept Problem

Why does constructor not required in structure ? Why does GC don't remove structures ? ...

c# globalization

Hello, Im making an application which uses few languages. I would like to have possibility to add resources in other language and us it after changing for example radio button in app without compilation so that each time user adds another file with resources (or changes resources file) it may be used during runtime without recompiling. ...

.NET Open Source Contour Plotting

I am looking for an Open Source .NET Library (or wrapper to a library) that will create contour plots from a set of values along a grid/mesh. ZedGraph is the closest thing I could find (http://zedgraph.org/). It would also be great if it could export to EPS. ...

.NET FINALIZE CONCEPT PROBLEM

Is it really better not to use finalize compare to dispose ? Does dispose remove unmanaged resource in first parse ? What is suppressing finalize ? ...

Disable ASP.net Cache

Hi All Is there a way to disable asp.net cacheing on selected page. It would be nice if this can be done from the web.config. ...

Determining whether to store XML data as XML or in normalized tables

(This post is soliciting personal experiences about storing XML; please share what you know. :-) ) I am working on a service application that communicates with an external service using XML. I am planning to use SQL Server 2008 to store the XML that is received and sent to the external service. I'm exploring my options for storing ...

Is it possible to place the ASP.NET DataProvider assemblies in a sub directory

Hello, I'm currently implementing some DataProviders according to the ASP.NET Provider Model. Everything works fine, though the application directory is a mess due to all the assemblies containing the data providers and their dependencies. Is it possible to put the assemblies containing the DataProviders in a subfolder? If yes, what do...

Why does MSDN say it's "rare" to load an assembly by path?

According to the documentation for System.Assembly: The LoadFile and LoadFrom methods are provided for rare scenarios in which an assembly must be identified by path. They suggest that you would more commonly load an assembly by its display name (for example, "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b...

Where Can I Find FileUpload Class for Windows Application?

I have this snippet: protected void ProcessUpload(FileUpload upload) { if (upload.HasFile) { string fileName = Path.Combine(Server.MapPath("~/Uploads"), upload.FileName); if (File.Exists(fileName)) File.Delete(fileName); upload.S...

How do I display a standard windows error icon for a custom exception handler?

As the title suggests, I just want to display a standard windows error icon for a custom exception handler. What the easiest way to achieve this using WPF? For example, the red cross in this dialog: ...

How can I make method signature caching?

I'm building an app in .NET and C#, and I'd like to cache some of the results by using attributes/annotations instead of explicit code in the method. I'd like a method signature that looks a bit like this: [Cache, timeToLive=60] String getName(string id, string location) It should make a hash based on the inputs, and use that as the ...

Global SqlConnection

I have a Web Service that requires an SqlConnection. There are 5 web methods that use this SqlConnection, but presently they are declared (locally) in each of the methods. Would it be acceptable to make it a global variable in this case? Thanks ...

Need to initiate seperate background processes using .NET Remoting for Interprocess Communication

Hello, I need to solve simplest problem. I have some abstract factory which will initiate on demand seperate processes(.NET EXE's). It means abstract factory needs to initiate processes at any time and let the newly created processes be able to communicate with process in which abstract factory reside. This interprocess communication is...

how to: make a panel resize with its form; and attach a console for output

Hi, guys how to make the Panel widget change it's size on Form1_SizeChanged how to attach a console window in order to see console.writeline messages ...