.net

string splitting based on char number

string data = "0000062456" how to split this string on 5 pieces so that I have: part[0] = "00"; part[1] = "00"; part[2] = "06"; part[3] = "24"; part[4] = "56"; ...

File writing problem on Windows 7 Professional in c#

I have an application in C# which I write some data to file. I am facing the problem on windows 7 professional that when I write data to C:\ProgramData, Access denied acception is thrown. If I login from an administrator account this issue vanishes, and if I login from some other account who have administrative previlages this issue come...

Why .NET does not allow cross-thread operations?

Possible Duplicate: .NET Controls: Why arent all calls thread-safe? This question is not about what is a cross-thread operation, and how to avoid it, but why internal mechanics of .NET framework does not allow a cross-thread operation. I can`t understand why a SerialPort DataReceived event cannot update a simple text box on ...

Set Theory and .NET

Recently I came across a situation where set theory and set math fit what I was doing to the letter (granted there was an easier way to accomplish what I needed - i.e. LINQ - but I didn't think of that at the time). However I didn't know of any generic set libraries. Granted IEnumerables provide some set operations (Union, etc.), but not...

Matlab and .NET Interaction

Hi All! I'm having an issue interacting between Matlab and .NET. I've managed to call .NET methods from Matlab code and vice versa. However, if I call a .NET method that, in turn, instantiates a Matlab object, it crashes (with a type initialization exception). Think about this scenario: a .NET assembly is interacting with a Matlab dll...

.Net: Do you know a complete downloadable Exception Handling tutorial or Resource ?

hi Do you know a complete Exception Handling tutorial which just focuses on it and talks about it in detail? EDIT: I prefer download-able resource. ...

Why can't I install MVC (1 or 2) with Visual Web Developer Express 2008 RC1?

Hi all, I have installed VWD 2010 Express and love MVC2. I have an existing ASP.NET 3.5 website that I'd like to redevelop with ASP.NET MVC2 under VWD 2008 with the 3.5 framework (the host only supports .Net 3.5, and Express 2010 doesn't support targeting of .Net framework versions) I am however unable to install MVC2 with VWD 2008. T...

Is there bug in the Matrix.RotateAt method for certain angles? .Net Winforms

Here's the code i'm using to rotate: Dim m As New System.Drawing.Drawing2D.Matrix Dim size = image.Size m.RotateAt(degreeAngle, New PointF(CSng(size.Width / 2), CSng(size.Height / 2))) Dim temp As New Bitmap(600, 600, Imaging.PixelFormat.Format32bppPArgb) Dim g As Graphics = Graphics.FromImage(temp) g.Transform = m g.DrawImage(image, 0,...

How to avoid having very large objects with Domain Driven Design

We are following Domain Driven Design for the implementation of a large website. However by putting the behaviour on the domain objects we are ending up with some very large classes. For example on our WebsiteUser object, we have many many methods - e.g. dealing with passwords, order history, refunds, customer segmentation. All of the...

Developing licenses in C# - where do I start?

Hi, I'm interested to find out whether there are any standards or resources that you can recommend for developing license models in C#? Thank you ...

How use math operations in XAML

I want use math operations in XAML code but I dont know how? ...

How Can I Choose Appropriate ComboBox Value Based on Select ListView Record? - C#.NET

Contact Title has a default value which is Sales Person. Anyhow, when a user click Edit on the chosen ListView record, i need Contact Title to have the right value that corresponds to the chosen record. For example, if user clicks edit, the fields on the left side will be filled with values. In this case, i want Contact Title to view t...

InsertFile operation in word 2007 document throwing “Command failed” exception

Hello, I get the “Command Failed” exception when using the following code to insert content from one word 2007 document into another using bookmarks in c# : string filePath = @“C:\temp\one.doc”; object trueObj = true; object falseObj = false; wordApp.Selection.InsertFile( filePath, ref missing, ref falseObj, ref trueObj, ref f...

.Net Entity objectcontext thread error

I have an n-layered asp.net application which returns an object from my DAL to the BAL like so: public IEnumerable<SourceKey> Get(SourceKey sk) { var query = from SourceKey in _dataContext.SourceKeys select SourceKey; if (sk.sourceKey1 != null) { query = from SourceKey in query where ...

SocketAsyncEventArgs and buffering while messages are in parts

C# socket server, which has roughly 200 - 500 active connections, each one constantly sending messages to our server. About 70% of the time the messages are handled fine (in the correct order etc), however in the other 30% of cases we have jumbled up messages and things get screwed up. We should note that some clients send data in unic...

Where Federation authentication token is saved [WIF STS]?

Hi all, While i started to explore WIF, i have a doubt on the following: In the Windows Identification Foundation[WIF],looking on to Security Token Service[STS], i wish to know where the federation authentication token is being saved? I think its in browser cookie, if so can anyone please give me a insight about it? ...

How much business logic belongs in RIA services layer?

I have been experimenting recently with Silverlight, RIA Services, and Entity Framework using .NET 4.0. I'm trying to figure out if that stack makes sense for use in any of my upcoming projects. It certainly seems like these technologies can be very productive for developing applications, but I'm struggling to decide how an application...

what is the namespace url for in the Service Contract attribute

In the [Service Contract(Namespace="http://myuri.org/Simple")] what is the Namespace for? I have done WCF services and never included this. What is it's purpose? ...

Loading assemblies dynamically‏ AssemblyResolve issue

Note: This is a continuation of my previous post: Complicated API issue with calling assemblies dynamically‏ I'm writing a .Net windows forms application that runs on a network and uses an SQL Server to save and pull data. I want to offer a mini "plugin" API, where developers can build their own assemblies and implement a specific in...

Making .net navigation menu role specific

Hello all. I'm currently using the good ol login control, .net membership & role providers for a web app I'm building. I have a tabbed navigation menu that I want to make role specific i.e. everyones sees 'Home', one role would be able to see additional tabs, another would be able to see three, etc. Doe sthe allow for such a thing? H...