.net

Embedded xml database with .NET binding

Hi, Does anybody know an embedded XML database which can run on Windows Ce 6.0 and which has .NET bindings ...

Alternative To A Series Of Overloaded Methods

I have a helper class that does a simple but repetitive process on a List of entities. For simplicity, it's like this... public static List<MyType> DoSomethingSimple(List<MyType> myTypes) { return myTypes.Where(myType => myType.SomeProperty.Equals(2)).ToList(); } I now need to add support for another type, but everything is identi...

How to check the number of bytes consumed by my Structure?

Hi, If I am creating realtively large structure how can I calculate the bytes it occupies in memory. We can do it manually , but if the struct is large enough then how to do it? Is there some code chunk or Application? ...

.net windows application with sql database + create a setup

Hello, I have created one windows application in .net 2.0 and it uses SQL database in back end. I want to create a setup file for this application so that I can install it and run it on any machine which does not have either .NET framework or SQL Server. Please give me some useful link for this. ...

How to prevent expected exceptions from breaking the debug test run?

When running MSTEST unit tests in debug mode, the execution stops in every expected exception that is thrown. My test looks like this [TestMethod()] [ExpectedException(typeof(ArgumentNullException))] public void ShouldThrowExceptionWhenPassingNull() { object data = null; target.CheckNull(data); } the target method looks like t...

ASP.NET's ObjectDataSource and NHibernate Session Management

Hello everyone. Let me describe the context first: In a .NET C# project, I use NHibernate to make the link between the C# objects and the database model. I have mapped my objects with NHibernate Mapping Attibutes. I have written data access queries in HQL, all of them being isolated in individual methods, which are decorated with attr...

Remove item from string array

I have a database field with data such as this: 76,60,12 If I want to remove, for example, 60, what do I have to do? The number to be removed could be any place. I also need to remove the comma, if needed. I'm using .NET 2.0. ...

Storing XML Audit

My program needs to start auditing saved XML data for users. Whenever the user clicks 'Save'; I'll need to insert his current data (serialized to XML) and save it somewhere. What is the better option between: 1) Creating a text file and dropping all the xml in there. (Creating a new text file per save) 2) Using a table in MS Access ...

Using local class in web service

I have a web service that accepts and returns a custom class. The problem is that the Form that calls the web service method requires instantiation of the webservice.myClass instead of the local copy of the myClass? For example: **myservice:** class myclass { ... } class myservice { [WebMethod] public void mymethod(myclass cls) { cls.x...

Copy the RequestMessage at IParameterInspector.BeforeCall() on WCF Service

Hi all, I have WCF service with IParameterInspector class which suppose to store the message for each incoming message. I need to extract values from the inputs parameters. In order to get the message I'm trying to access Blockquote OperationContext.Current.RequestContext.RequestMessage Blockquote and than call to CreateBuffe...

How can I split a string into two separate arrays using the .NET framework?

I've got a string containing both ints and a string. How do I split it into two arrays, one for ints and one for the string? I also need to maintain the order because I'm writing a file parsing system that depends on reading in and correctly splitting these strings. EDIT: Here's a sample input, and what I would like as output: ~Wolf 10...

project location not trusted in VS2010

How to get VS2010 to trust a location and not ask for permission before opening projects from location not trusted? There used to be a .NET 2.0 configuration tool --- is there a .NET 4 equivalent related to this http://stackoverflow.com/questions/2603144/the-project-location-is-not-trusted-error-in-visual-studio ...

Open Source or Free .NET HPC Implementations

I'm trying to find out how feasible it would be to create a compute grid using Windows XP, Vista and 7 machines. I know that there is already Windows HPC Server 2008 out there, but when looking into the cost it was basically a situation of if you have to ask, you can't afford it. I did find MPI.NET, however this looks like it hasn't be...

How to add %rate to a progress bar?

I want to write the rate of progress on the progress bar. I've attached a label to on it. But it's not effective. Any easy way to do it ? private static void ReportStatus(int totalBytes, int processedBytes, Aumpel aumpelObj) { progressBar1.Value = (int)(((float)processedBytes / (float)totalBytes) * 100); labelProgr...

Block a row from reads whilst sp executes

Hi, I have many .NET processes reading messages from an SQL Server 2008 DB table and processing them one at a time. I implement a simple SP to 'lock' the row that is being read by any one process, to avoid any two processes processing the same row. BEGIN TRAN SELECT @status = status FROM t WHERE t.id = @id IF @status = 'L' BEGIN ...

Get maximum Rectangle placed within Polygon or Path

How to get maximum Rectangle that can be placed within Path or Polygon. I need some functionality to get it. ...

Stop or move the mouse

I have a graphical application in which I move a graphic object with the mouse. In some conditions, the object stops moving. I need then to stop moving the mouse cursor too. Is it possible? MousePosition property seems to be in ReadOnly. Eg. public partial class Form1 : Form { public Form1() { InitializeComponent(); ...

Formatting a JavaScript date into a string for JSON DeSeriailization.

Hi, I am using the .NET NewtonSoft JSON serialization library and it is expecting date fields in this format: "UpdateTimestamp":"\/Date(1280408171537+0100)\/" Does anyone know how I can format javascript date object into this format? Thanks Paul ...

Is there a faster way to retrieve System.Environment.UserName?

System.Environment.UserName internally calls [DllImport("advapi32.dll", CharSet=CharSet.Auto)] internal static extern bool GetUserName(StringBuilder lpBuffer, ref int nSize); Each call seems to hit AD, thus network latency and AD query effect speed of execution. Would you know if there is a better way to retrieve this value? Somethi...

Good linear programming library for C# ?

I'm looking for a linear programming solver for C#. In the other words I'm looking for a library for C# that solves linear programming problems. I need an easy to use library (so I can learn how to use it quickly), but it would be nice if it supported some features as automatic absolute values conversion (so I don't have to program the ...