.net

Is DataRow thread safe? How to update a single datarow in a datatable using multiple threads? - .net 2.0

Hello all I want to update a single datarow in a datatable using multiple threads. Is this actually possible? I've written the following code implementing a simple multi-threading to update a single datarow. I get different results each time. Why is it so? public partial class Form1 : Form { private static DataTable dtMain; pr...

.NET SAP Connection Authentication via WEB Service

Hi, I am trying to connect to a web service served by SAP and i have authentication problem. I simply added the service by right clicking project, selecting add service reference, giving WSDL url for the service and clicking OK.(After clicking ok asked for credentials and i provided them) Then when i tried to call a method from the se...

How to Clear an image control in WPF (C#)

I have an image control with a source image located in my c drive. I get a message that the image is being used by another process whenever I try to delete the original image to change it with another one dynamically. How do I release the image from the image control to be able to delete it. I tried this variants: string path = ((Bitma...

LINQ to XML Cloning

Can anyone explain why the original address XElement street node changes? It looks like customer1 holds a reference to the address XElement but customer2 and customer3 have taken copies. Why did the original address change? (LINQPad example) var address = new XElement ("address", new XElement ("street", "Lawley St"), ...

what knid of usage " [MenuAction("apply", "global-menus/MenuTools/MenuToolsMyTools/Tool1", "Apply")]"?

MenuAction,ButtonAction,... etc why i need this type usage. i really what it is [ButtonAction("apply", "global-toolbars/ToolbarMyTools/Tool1", "Apply")]. Can you give me some tips or advise or site link. i don't really know [Myclass]. is it AOP? [MenuAction("apply", "global-menus/MenuTools/MenuToolsMyTools/Tool1", "Apply")] // ...

[C#] PageSetupDialog not returning PageSize correctly

I'm trying to set up the print page for a document, using PageSetupDialog. Before I open the dialog, the document is set correctly, page size and page source are set correctly too. But when I return from the dialog after select a different paper size and paper source, the paper size is not correctly reflected, while the paper source is ...

.NET Framework 4 Client Profile vs .NET Framework 3.5 Client Profile

Currently I am targeting .NET Framework 3.5 Client profile. Under certain conditions (when .NET 1.x or 2.x is installed) the client profile is not installed and instead full version of .NET Framework 3.5. is installed. This limitation has been removed from .NET 4.0 profile - therefore its a nice improvement that significantly reduces d...

Autocomplete with force of a choice

Hi I want to use autocomplete (jquery or .net) with force a choice so that the user must always choose something. There can be no possibility of entry, the user can only choose. Does anyone know how to do this?? I want to use webservice for this purpose, because the results will be a lot, and I'll show you the first few. I want to ...

log4net dependency problem

I have an issue with log4net which has been bugging me for a while and I've resolved to sort it. I have a class library which references log4net. If I reference this class library in another project I must then reference log4net in this project otherwise I get a build error Unknown build error, 'Cannot resolve dependency to assembly 'l...

ASP.NET MVC Stored Procedure

I am using a ms sql stored procedure to get a set of records , when i am adding this stored procedure to my LinqToSql class and using it my repository it shows like it is returning a int value but it should be returning a set of rows. Is there some thing wrong with my stored procedure or some thing else??? ALTER PROCEDURE [dbo].[GetDoc...

How do I manage access in Windows Identify Foundation without raising exceptions?

In the Windows Identity Foundation (WIF), there is a class called ClaimsPrincipalPermission. The documentation on MSDN is very sparse. It states: ClaimsPrincipalPermission represents the permission required to access a resource. ClaimsPrincipalPermission takes in a string that represents the resource to be accessed, and a string t...

Unable to debug XBAP with Visual Studio 2010

Just migrated my project to Visual Studio 2010, but target framework was left 3.5. Project contains an XBAP app in partial trust and a bunch of WCF services. Debugging is configured to start PresentationHost.exe with -debug and -debugSecurityZoneUrl parameters. Under VS2008 everything works fine, and in VS2010 Beta2 (don't sure about R...

.NET values lookup

Hi, I have a feeling of missing something obvious. UDP receiver application. It holds a collection of valid UDP sender IPs - only guys with IP on that list will be considered. Since that list must be looked at on every packet and UDPs are so volatile, that operation must be maximum fast. Good choice is Dictionary but it is a key-value ...

Strange MSI error when setup.exe is run

We're using Visual Studio 2008's Setup Project to create an installer for our .NET 3.5 app. We host the .exe and .msi files on a website for our client to access, and produce new ones regularly to provide updates. This has all been fine until recently we've noticed some cases where installing via the .exe fails. The symptoms are: The .e...

Do I need to Dispose to deregister events?

Say I have two classes, and neither of them are GUI components. Class A is a short lived object that registers for an event declared by a long lived object B. For example public A(B b) { b.ChangeEvent += OnChangeEvent; } If A never deregisters from B's event, will A never be garbage collected? Does A need a Dispose method just t...

VB.NET ASP.NET Web Application woes (VS 2008)

Hi all, I am making my first web application with ASP.NET and I am having a rough time. I have previously created the application I am working on as a Windows Form application and it works great, but I am having problems with the HTML side of things in the web application. My issues are pretty minor, but very annoying. I have worked w...

FluentNHibernate: returning an enum from a derived property

I'm using the automapping feature of FluentNHibernate and need a property that derives its return value. This property must return an Enum value, e.g. public virtual MyEnum MyDerivedProperty { get { MyEnum retval; // do some calculations return retval; } } Currently I get the following exception: NHib...

Running executable asynchronously from web application (safe solution)

What are the alternatives to System.Diagnostics API for running external EXE or BAT files under IIS hosted web application? I would like to run external EXE program from my ASP.NET-MVC web application. I don't need to wait till the program exits. I just want to start the program. The execution can take some time or it may crash, so I wo...

Choosing the right .NET architecture. WCF? WPF/Forms, ASP.NET (MVC)?

I’m in the situation that I have to design and implement a rather big system from the bottom. I’m having some (a lot actually) questions about the architecture that I would like your comments and thoughts on. I don’t hope that I’ve written too much here, but I wanted to give you all an idea of what the system is. Quick info about the a...

NLog not logging messages on XP SP3 with .NET 3.5 Client Profile

I'm writing a program that is targeting the .NET 3.5 Client Profile and using NLog. I configure my logger programmatically on start up (no config file.) It works perfectly on Vista and Windows 7, but when running on a fresh install of XP SP3 with the .NET Client Profile installed, it will not log any of the variables in the layout stri...