.net

How to make NHibernate serialize a given property to a binary field?

Hi everyone, I have a simple ASP.NET MVC web application that uses NHibernate with FluentNHibernate's auto mapping feature for its data access. I have encountered a scenario in which I would like NHibernate to persist some classes as binary data. For example, I have something similar to this: public class User { ... // This f...

MDI Child form not getting minimized

I have an MDI form and several number of child forms inside that MDI. On clicking a button in the menu, a form opens. If another form is already open then that should get minimized and the new from should open. The problem is even if i give frm.WindowState=WindowState.Minimized, the form does not get minimized. The code that I have writt...

Show a custom popup if someone doesn't have the required .NET-framework to run an application

I built an application for version 4 of the framework. When I try to run it it says: In order to run the application, you have to install the following version of the .NET-framework first: v4.0 [...] That already isn't too bad but it would be great to display a custom message, maybe even with a link to the latest version of the fra...

C# value type casting: how it works?

Possible Duplicate: Why does this conversion doesn't work? Hi, i discovered a strange behaviour of the framework. This code throws an exception: byte a = 1; object b = a; Console.WriteLine(b.GetType()); Console.WriteLine((byte)b); Console.WriteLine((int)(byte)b); Console.WriteLine(Convert.ToInt32(b))...

RegEx a RegEx match

Hey there, I'm having trouble building the correct regex for my string. What I want to do is get all entities from my string; they start and end with '. The entities are identifiable by an amount of numbers and a # in front. However, entities (in this case a phone number starting with #) that don't start or end with ' should not be matc...

Extracting data from an ASPX page

I've been entrusted with an idiotic and retarded task by my boss. The task is: given a web application that returns a table with pagination, do a software that "reads and parses it" since there is nothing like a webservice that provides the raw data. It's like a "spider" or a "crawler" application to steal data that is not meant to be a...

How do I join 2 xml files returned from 2 api calls?

I am using the web service API of a third party application to search for data via my web application. There is a contacts API and a client API. The contacts table holds the ID of the client, but not the name. To search for and display a contact and also display the name of the client I need to call both API's. What is the best way of ...

Tab space in ASP.NET listbox

Hi, Anyone know how to insert tab characters in an ASP.NET listbox? I want to use it so that all my items are lined up because i have two fields on each line a number and a name. In winforms all I have to do is: Listbox.Items.Add(number + "\t" + name); But in ASP.NET Webforms this doesnt work any ideas? ...

.Net Micro Framework Emulator : change value returned by SystemInfo.SystemID.Model

I'm trying to make an emulator for FEZ and their implementation throws an exception if the value returned by SystemInfo.SystemID.Model is not what's expected (1 in my case) Is there a way to modify the value returned by SystemInfo.SystemID.Model for the applications running inside my emulator ? ...

File (or assembly) can't be found after changing project's .NET target-framework from 4.0 to 3.5

I want to change my C# project, which is based on the .NET 4.0 to 3.5. So I changed the project's target-framework to 3.5. After re-opening and trying to compile the project I get the error: The file or assembly "System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" or one of its dependencies couldn't be...

Module Not Found Exception From .NET 2.0 Web Service On Windows Server 2008 R2

Hi, We have an issue with a .NET 2.0 web service application that is generating a module not found exception when we try to load on server 2008. A second server running the same 2008 version loads the service fine. As part of the investigation we have taken the default hello world .NET 2.0 web service and deployed to both servers and h...

Using SQLDependency/SqlNotificationRequest to have multiple instances of the same app receive the same notifications?

I started looking at this recently with the very limited knowledge that the ASP.NET Cache could somehow make use of a SqlCacheDependency to invalidate the cache when a table (or a queries results) change. This lead me to the SQLDependency and SqlNotificationRequest classes. While the details of the SqlNotificationRequest class still e...

Parse a custom JSON object in .Net?

For my ASP.Net application I need to use a HTTP REST API that returns a JSON object. Here's how the JSON looks: message: [ { type: "message" href: "/messages/id/23" view_href: /this-is-a-test-message/m-p/23 id: { type: "int" $: 23 } }, { //... } ] I could use the DataContract...

how to Save the State of an c# App with powerShell?

Hi! I have a C# program in which the user adds multiple objects an editing Panel. These objects are all represented as a classes. Now I want the user to be able to save the scenario, so it can be loaded again. for that I want to generate a Powershell script of each scénario , but my probléme is how to save diferent objects on Powershel...

WCF data marshalling

1st of all, apologies if this is a basic/simple WCF question, i'm a WCF newbie and haven't come across this so far. Question 1 - Is there a way to see what data is marshalled on a wcf service call ? and given the following definitions Interface IX { List<string> list; Dictionary<string,MyType> dict; } Interface IY : IX { L...

Why would you not use WCF Data Services for querying data?

OK, so we are using entity framework and wish to expose data from these entities to consumers. This data is pretty common and although initially only consumed by WPF applications it could be consumed by other technologies such as Silverlight, ASP.NET, Office, etc in the future. Typically you would build WCF services that expose a number...

WCF Return Types

I've got a WCF web call which returns the result of a SQL Command. However this SQL Command is dynamic so i don’t know how many columns and what data types there are going to be. How do i the results over WCF to a Silverlight application? (Btw i then want to be able to put this data into a data grid) Thanks ...

xsl to remove comments from all the nodes

hi, I am using xsl script to remove comments from all the portion of the xml. It is actually removing the comments which are in parent node but not from the other interior nodes. [edited] Updating the question. My requirement is to remove all the comments from entire XML document. ...

Catalogue Design

Hey, Please have a look at http://live.heritageartpapers.co.uk/catalogue.aspx and advise me on the following: Currently customers are getting confused (judging by the one who clicking the same link 20 odd times yesterday) because each level of product is pretty much the same. I would like to differentiate each level of product. However...

Maintain generic list between postbacks

Here is what is in my code-behind: List<Event> events = new List<Event>(); protected void Page_Load(object sender, EventArgs e) { } protected void AddEvent_Click(object sender, EventArgs e) { Event ev = new Event(); ev.Name = txtName.Text; events.Add(ev); } I want to add an item to the list every time the Add button i...