.net

Why can't i use NVelocity with the Asp.net MVC Beta?

I have added the required assemblies and registered the NVelocityViewFactory in global.asax.cs page but when i run the site i get the following error Could not load file or assembly 'Microsoft.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. Any help...

How do you restart an app/reread app.config file when modified (.NET)?

We all know that modifying a .NET web application's web.config file restarts the app and makes it read the updated configuration. How do you do that with a console or WinForms app? Thanks :) ...

Stored procedure causing timeout only when run from application

Hi, We have runned into a problem with an sp. We have a pretty simple sp containing a declared table and a couple of outer joins that in the end returns between 20 and 100 rows. Since querying this sp has been giving us poor performance both in production and in testenvironment we recently rewrote it to be more efficient and has teste...

Can I be sure the built-in hash for a given string is always the same?

I am getting a string hash like this: string content = "a very long string"; int contentHash = content.GetHashCode(); I am then storing the hash into a dictionary as key mapping to another ID. This is useful so I don't have to compare big strings during default dictionary hash computation but I can just fish the ID from the dictionary...

Set OpenFolderDialog to a special folder

Hi, I know it is possible to set the current folder of the OpenFolderDialog to a special folder, like "Program Files" or Desktop? But where do I find this? ...

Developing for a Windows Mobile Phone, without a contract

Greetings! Anyway, My question, If you want to experiment developing for a Windows Mobile device, how would you go about testing your applications? I know there is a emulator but is not really ideal. Is there anyway, without paying a stupid astronomical cost, to get a development phone? Akin to what Google did with the android and I ...

Rasterizing PDF documents programatically

I'm currently working on a project where I've been tasked with implementing a feature that will allow users to flip through a book in PDF format. I've tried searching for existing software and components that would help with this task, and I've found a few... The problem though, is that the client is quite rigid about how they want thi...

getting selected check box value in Mvc asp.net

I had displayed check box in a list and i want to access that which check box is selected or not and want to call controller action where i select option from dropdown list <div id="pnlSent" style="display: none"> <%= Html.DropDownList("select","msgtype") %> <% foreach (Usp_GetUserMessagesResult w in (List<Usp_Ge...

ASP.AJAX UpdatePanel - probably related to application mapping

I am trying to use the Axinom CMS with ASP Ajax and created a page containing ScriptManager, UpdatePanel and Timer. When publishing the page in the CMS the actual page is created under (1) http://localhost/Site/publish/PageName.aspx but the user is meant to access it under (2) http://localhost/Site/PageName.AxCMS which is e...

Quartz.net implementation

I am new to the concept: quartz.net.How do I implement it in my web application ? ...

How can I have a WinForms program do some **specific thing** whenever a certain time-based condition is met?

How can I have a WinForms program do some specific thing whenever a certain time-based condition is met? I was thinking I could do something with two threads, where one thread runs the normal program, and the other thread merely loops through checking if the time-based condition is true yet or not, and when the condition is true it sign...

Why are multi-dimensional arrays in .NET slower than normal arrays?

Edit: I apologize everybody. I used the term "jagged array" when I actually meant to say "multi-dimensional array" (as can be seen in my example below). I apologize for using the incorrect name. I actually found jagged arrays to be faster than multi-dimensional ones! I have added my measurements for jagged arrays. I was trying to use a ...

Is there a tool for checking CLS Compliance

Is there a tool out there that anyone knows of that can analyse my .net code (C# and vb.net) and tell me why things are not CLS Compliant? Visual Studio is happy to tell me a parameter is not CLS compliant, but it gets me no closer to fixing the problem as i don't know the cause. Example VS Error: parameter 'xyz' is not CLS-Compliant ...

CType equivalent on .NET Framework 2.0

In VB.NET CINT(VB.NET) is Integer.Parse in .NET Framework, what is the .NET equivalent for (VB.NET) CType? ...

How to get the data in a System.Object

I'm using a COM object that has a function called GetImage. http://www.pdf-tools.com/asp/products.asp?name=P2IA When I use it in Visual Studio 2008 it returns byte[], but when I use it in RAD Studio 2007 it returns System.Object. How can I get the data from the System.Object into a byte[]? ...

Switching to Release Build causes runtime error in Web Reference

I've got a problem with a SOAP Web Reference that was generated by Visual Studio 2005 (.NET framework is v2.0.50727.42) - it works fine under the Debug build configuration (and has for months) but now that I want to go live and have compiled using the Release configuration, it has stopped working. Exceptions are raised at runtime whenev...

How to make it so if one copy of a program is running another won't be able to open?

How to make it so if one copy of a program is running another won't be able to open? Or better yet, how to make it so that if one copy is already running, then trying to run another copy will just act as if you maximized the original process? ...

Are there still known memory leaks with XMLSerialization in .Net 3.5?

This article http://blogs.msdn.com/tess/archive/2006/02/15/532804.aspx by Tess Ferrandez outlines why using XMLSerialization can cause memory leaks. The leak is a result of how the objects are instantiated in memory as assemblies, not objects so are not targeted by the Garbage Collector. The article was originally written on the 1.0/1....

WCF Service stops working, error is in web.config: cannot add duplicate collection entry of type 'add' with unique key att name set to 'scripthandlerfactory'

My web service (wcf) stopped working all of a sudden. I compared my web.config with older versions and they all have the exact same elements so I am very confused why all of a sudden I am getting this error message. Have any of you run into this problem before? Filename: web.config Line Number 151 Error: cannot add duplicate collectio...

String Utility Library for Code Generation

CodeSmith has a nice StringUtils class that can be used to change database object names to singular, plural, camel case, pascal case, etc... Very useful for creating data access layers in their code generation tool. I'm trying to port some CodeSmith templates to the T4 template files used by Visual Studio, and I'm trying to find a si...