.net

Distributable ASP.NET web server for a commercial product

Does anybody know of a commercially supported distributable web server that can host ASP.NET applications? I have a commercial server based application to which I want to add a web interface (sort of like a portal for clients.) I cannot expect that all of my customers will have, or want to run, IIS. Cassini seems a bit limited withou...

NHibernate - Force esacping on Table Names

Are there any good examples of how to use this (NHibernate.Criterion.IdentifierEqExpression) online? I couldn't find any. I'm a little confused about what you are supposed to pass into the constructor. I pass in an int32 of 1 and I keep thinking my test should basically do a "where id = 1" type of query and instead it blows up with "wh...

ASP.NET Page Designer for Linux

Is there a simple, yet decent .aspx designer that runs on Linux? I've since all the ones in this question but none satisfied the "runs on Linux" condition. By decent, I mean that the designer allow me drop asp.net webcontrols on a webpages for futher use in Monodevelop. ...

NHibernate - Many-to-Many Joined back to Itself

I'm trying to create a simple User object that has a Friends property that points to an IList. Started off just trying to get an ISet to work. <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false" assembly="MyProject.Domain" namespace="MyProject.Domain"> <class name="User" table="[User]"> ...

Fastest way to calculate the decimal length of an integer? (.NET)

I have some code that does a lot of comparisons of 64-bit integers, however it must take into account the length of the number, as if it was formatted as a string. I can't change the calling code, only the function. The easiest way (besides .ToString().Length) is: (int)Math.Truncate(Math.Log10(x)) + 1; However that performs rather po...

Generate User Friendly Codes

I am researching methods to generate a random human friendly code but not (easily) guessable. This will be used to give away prizes (think unique discount codes). We are to generate about 50k. Are there any standard methods/algorithms to accomplish this? I was thinking of using a GUID and applying CRC. Is this a bad idea? Using .netfram...

Are .NET ref parameters thread-safe, or vulnerable to unsafe multithreaded access?

Edit for intro: We know that a ref parameter in C# passes a reference to a variable, allowing the external variable itself to be changed within a called method. But is the reference handled much like a C pointer (reading the current contents of the original variable with every access to that parameter and changing the original variable ...

Is it possible to post code taken from the .net framework and modified online?

I used reflector to view the code of the generic dictionary collection (Dictionary<TKey, TValue>) and modified that code to make it thread safe. I want to post this code on my blog so others can review it (and tell me if I did something wrong) and also use it in their projects if they want. Legally speaking, am I allowed to do so? I modi...

Is it possible to create a page from a string in ASP.Net?

Hi, I can create a page from a file with: Page page = BuildManager.CreateInstanceFromVirtualPath( virtualPath, typeof(Page)) as Page; How can I instantiate a page from a stream or a string? Thank you. ...

Web Service clients

Hi guys, I have a .net based asmx service and I trying to find out details on the clients that are currently using it. Just wondering what is the best way to gather the information on things like the IP address of the client, the URL that is using my service and so on. Cheers ...

WPF binding multiple controls to different datacontexts

I have a scenario where I don't really know how to bind data to controls hosted in a UserControl to multiple datacontexts. The data i want to bind comes from 2 classes UserInfo, UserExtendedInfo The datacontext of the UserControl is set to UserInfo so i can bind most controls easily doing the following <Label Name="LblEmail" Text="...

Sorting a list box using check or unchecked

Hi I am using a checked list box in my project c#.net windows application. I want to sort the list box such that checked items should come first and unchecked displays after it. How can i do it ? any code to do it ? ...

.NET MailMessage and SMTPClient Getting Tagged as Spam?

I'm preparing basic HTML email and have used a basic HTML template with proper HEAD and BODY tags, but for some reason, my users are having trouble getting emails from me. I'm using ASP.NET MailMessage and SMTPClient objects and the mail sends just fine, I can get test messages to myself and most users are getting them, but some sites a...

Compiling Linq to SQL queries from a non-trivial IQueryable

Is there a way to use the CompiledQuery.Compile method to compile the Expression associated with an IQueryable? Currently I have an IQueryable with a very large Expression tree behind it. The IQueryable was built up using several methods which each supply components. For example, two methods may return IQueryables which are then joined i...

What is the best dot net unit test framework with visual studio integration?

What is the best dot net unit test framework with visual studio integration? ...

Combining resultset in C# using Linq

I have two tables 'toc' and 'content' with the following structure: toc id name(50) content id text(500) title(50) tocid I am searching the for some text within toc.name, content.text and content.title and require a single resultset. Is it possible to combine the search results using linq(c#). I want the resultset as something like...

Use BuildManager.GetType to look through assemblies in WPF

I have existing code for an ASP .NET application that uses reflection to load dataproviders. I would like to re-use this code in a WPF application but it appears that BuildManager.GetType only looks through top level assemblies if the app isn't ASP .NET. Does anyone know how to get around this limitation? The following code throws an ex...

Cannot upload a zip file of more than 5000 k size

Hi I am a fresher to C#,i am able to upload a file to server with less size but when i am trying to upload a size more than 5000k it is giving an exception. Here is my C# code private void UploadFile(string filename) { try { PeopleMatrixService peopleMetrixService = new PeopleMatrixService(); String strFile = System.I...

Tooltip for each items in a combo box

Hi I just want to add a tooltip for each item in a combo box. i am using c#.net windows application. There is no option like combobox.items[1].tooltip(); Is there any way to add tooltip it ? ...

How do I get drag and drop control in WPF like Solution Explorer in Visual Studio?

Can any one provide a solution regarding drag and drop window or panel? I mean I want a panel for buttons to move where I wish via mouse moving. For example moving the menu bar by dragging mouse like that I want one menubar moving in my WPF Windows application. What do I have to use and how? ...