.net

Will .net 2.0 and 3.5 run side by side?

We're a development shop that still does most of our development in .net 2.0. We're starting to think about using some of the new things in 3.5 (LINQ, etc) and there are some other software packages we're looking at that need WPF and so on. We'd like to get 3.5 up and running on our test server, but without wrecking any of the 2.0 site...

Passing focus of child element in a UserControl to parent in WPF

I have a complex WPF UserControl made of other ContentControl templates which contain sets of buttons, textfields, and other elements. The parent UC is focusable so I have a style with a property trigger to update (gratuitous OuterGlowBitmapEffect) when the UC has focus. However when the user clicks or tabs to any of the buttons inside ...

How can I check for DBNull while executing my command only once?

When I retrieve any Scalar value from the database, I usually write code like this for nullable fields. cmd.ExecuteScalar() == DBNull.Value ? 0 : (int)cmd.ExecuteScalar() But I don't like it because it executes the Executescalar statement twice. It's an extra trip to the server for my website and in favor of performance I don't want t...

Deleting files using a service application

I am using a FileSystemWatcher in VS2005 to monitor directories and thought to change the application to a service. Eveverything woks fine until the service tries to delete a file. Sending the exception to the eventviewer, I get a System.UnauthorizedAccessException. The file in question (testing) can be deleted by the same FileSystemWatc...

Asp.Net Mvc Utilities and Helpers

I'm really new to ASP.Net Mvc, but not new to Asp.Net. I was aware of all of the HtmlHelper class, but I was having problems with ecoding issues using Html.ActionLink. I asked a question here and got an answer right away about using the UrlHelper class, which I had no idea even existed. My question is, are there other classes like this ...

Beginner Rhino Mock problem

So I'm new to rhino mocks and I'm trying to get it going in a MVP patterned project I'm on. So I've got an interface representing my View and a class for my Presenter like so: public interface IView { string SomeData { get; set; } } public class Presenter { public IView View { get; set; } public void Init(IView view) { this.V...

How to diff Property Values of two objects using GetType GetValue?

I have the following classes: public class Person { public String FirstName { set; get; } public String LastName { set; get; } public Role Role { set; get; } } public class Role { public String Description { set; get; } public Double Salary { set; get; } public Boolean HasBonus { set; get; } } I want to be abl...

What's a good "mobile" .NET database that supports LINQ?

I'm in the process of refactoring an application and I've decided to use a mobile/embedded database. I've been reading about SQL Server Compact Edition, but I was wondering if any of you knew of any other databases that could be used and don't have huge download sizes, as my current application is about ~2MB (installer). SQLite would be...

AccessViolationException on OdbcDataReader.Dispose()

Hi, I am getting this exception when disposing an OdbcDataReader just after retrieving data from the database. The reader is actually disposed while leaving a Using block. This should not be causing any errors as far as I know. Any ideas? System.AccessViolationException: Attempted to read or write protected memory. This is often an ind...

Creating custom contextmenu

I have a v simple dialog box that I would like to display as a context menu. I can catch the right click and show it as a modal dialog with no borders, if possible I would like it to look properly like the windows context menu (bar on lhs, blue border) - is there a way of doing this automatically to collect user desktop settings, (needs...

How to get better performances using TIBCO RV from C#?

I'm using TIBCO RV .NET API (TIBCO.Rendezvous.dll). Do you know if there is a better way, in term of performance, to receive and read messages from a RV channel in C#? I found the Message type - the logical wrapper over a RV message - being quite heavy. Getting a field by name or by index could be pretty slow, especially when we consid...

NHaml configuration problem: Model is not found

Hello. I'm having a little problem with my NHaml config: <configSections> <section name="nhaml" type="NHaml.Configuration.NHamlConfigurationSection, NHaml"/> </configSections> <nhaml AutoRecompile="true"> <assemblies> <add assembly="Microsoft.Web.Mvc"/> <add assembly="MyAssembly"/> </assemblies> <namespaces> <add ...

Has anybody used Manco.net Licensing for .Net?

http://www.mancosoftware.com/licensing/index.htm Just wondering what your thoughts are on it, if it's relatively good for the 80$ charge. We realize stuff will still get cracked, but prevention from the masses is also good to consider. Any input is appreciated. ...

XmlDocument and slow schema processing

I have an xml template document that I need to load into an XmlDocument. eg myXMLDocument.Load(myXMLFile); However this is very slow as it loads in the dtd. I have tried both "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" and a local copy of the dtd. Both take more or less the same time. If I turn of loading the dtd by setting the ...

missing file or assembly tinymcetextbox

Hi There I have a project I am doing some maintenance work on and have got the solution files etc and attempted to build it and have got the following error:- Error 4 Could not load file or assembly 'TinyMCETextBox' or one of its dependencies. The system cannot find the file specified. This is a .net 2.0 project. Can anyone give me ...

How should I approach Continuous Integration and .NET Framework Versions

Hello, I am just beginning the move to the .NET Framework 3.5. I use CruiseControl.NET for our Continuous Integration and would like to know how other people approach setting this up. I have a branch of the source code entitled NET3.5 but for now am keeping the trunk as 2.0. I have created two CruiseControl projects that checkout from...

StringDictionary not saving as user setting

I've created a user scoped setting with the type "System.Collections.Specialized.StringDictionary". Whenever I open the local settings, I can see it in the config, but it's empty. I have other user settings that save correctly, but this dictionary doesn't seem to be saving at all. Is there something I need to do in order to get a dict...

Using uniqueidentifiers/guids as custom properties in log4net

I'm trying to add a custom property which is a guid, but it gives me this error: System.InvalidCastException: Failed to convert parameter value from a String to a Guid. ---> System.InvalidCastException: Invalid cast from 'System.String' to 'System.Guid'. I specify this in the config: <parameter> <parameterName value="@id...

Persisting three related tables using nhibernate

We have three tables A, B, C. Columns A => id, x B => id, y C => A.id, B.id For every row in A there will be a row in B. To relate A and B we are using C (we cannot change the table design). We have to persist information in one transaction. Is there a way to do it using NHibernate? ...

ASP.NET Membership Provider with Confirmation email

Is there any framework/library for using ASP.NET Membership Provider with confirmation email, something ready to be used ? Standard functionality used on almost all public web sites. ...