.net

.net registry reading writing

Hello all Can you refer me to some good reference how I can read write to registry via .net resources ? I checked the site and couldn't find any good information. Thanks a lot for help. ...

Current Directory of a VB.net Windows Service

Hello, For some reason the Current Directory of my windows service is C:\Windows\System32 and when I schedule my service I get this error Access is Denied. In one of the blogs I saw this peice to change the current directory. But I am not sure where to place this code. Thanks System.IO.Directory.SetCurrentDirectory(System.AppDomain....

Best practices for creating libraries that use .NET namespaces

Is it bad practice to write a library that defines an interface dependent on another library? I know tight coupling is bad, but does this still apply when using .NET classes? For example, in .NET, if I have a library that returns a Color object, it would force a dependancy on System.Drawing on anything that uses my library. Would I be...

refresh winform

I have a WinForm that contains a bunch of labels. When the form loads I have it populate the labels with some data that I retrieve in my middle tier eg. current # of files in a certain directory. I want to put a button on the form which when pressed will refresh all the data/labels. What should the logic of my button's click event be?...

Best way to access data stored in relational files (not DB2) on an AS400, using .NET?

We have need to connect to an AS/400 from .NET (C#) and access (read and write) data. The issue is the data is stored in relational files on the mainframe, not in a DB2 database. What is the best way to accomplish this? I would love to use an ADO.NET Entity Framework type solution, but I believe the compatible data providers only work ...

How do you get the default system font in the .NET compact framework?

How can I get the Font object for the default system font used by the particular device? I've noticed that different devices have different resolutions and DPIs, but some of my controls have explicitly defined fonts. I'd like to be able to get the default system font at runtime (as if I never changed the Font property on the control). ...

.NET MVC + Sensitive Data

I am iterating through a List of custom data objects and outputing the data to the screen in a pageable format. Each item needs to offer the ability to edit the details (a redirect to another view) and to remove the data. In order to do this I will need to pass an id of some sort to identify the record that is going to be updated or dele...

Anticipating possible circular-reference situation in upcoming .Net project idea... anything to watch out for?

So I've got this data access layer, and I also want to log to the database. In the spirit of eating my own dog food, I want to use my data access layer to do the logging. However, I also want to log the data access itself. Like so: App || V Log || V Data=>Log Am I at risk of getting into a feedback loop? If so, how should I avoid it? ...

Overwrite binary operators in C#

Hello I have a Expression.GreaterThanOrEqual(left, right), so I want to evaluate string or domain types with data like : 002-1400 so when I use GreaterThanOrEqual operator ">=", I will be able to say 002-1400 "is greater or equal than" 002-1400, 002-1399, 002-1398 ... So I can play with some grid rows for compare via input parameters....

Using SharePoint 2010 webparts in a classic .net asp application

Does anyone have an experience using SP2010 Web Parts in a classic aspx application, assuming you would reference sharepoint dlls? I am referring specifically to the search center web parts? Thanks ...

Nhibernate DetachedCriteria: Find entities where a property's property match a value

Hi, I have two following classes: public class User { public virtual Guid Id { get; set; } public virtual UserCredentials Credentials { get; set; } // other stuff protected User() { } } public class UserCredentials { public virtual Guid Id { get; set; } public virtual string UserName { get; set; } // oth...

Unterminated string constant error

We just dicovered a bug in our app that returns this error. When going to a certain page in our ASP.NET 2.0 app. When I press "Yes" to debug, the source of the page is displayed, but the line that is referenced has NO Java script on it. I am trying to figure what maybe causing the issue and how to debug it. This is IE only application. T...

UnauthorizedAccessException when deleting windows mobile shortcut

Hi, I need to create a utility program which runs on windows mobile. I need to have the .cab file install the program and a shortcut to \Windows\Start Menu\Programs. The user launches the program with this shortcut. I then need to delete the shortcut after the application has been run the first time. I'm currently getting an Unauthori...

IPWorks alternative

I have previosly used IPWorks .NET suite of controls (or atleast a few of them). And since I only use the basic controls Ipport, Telnetport and IPdeamon I would like to find an alternative. So is there any OpenSource or cheaper controls out there? Dont get me wrong, if I would use more of their controls I would buy a new licence becaus...

Purpose of ServiceContainer

I cannot seem to find what the ServiceContainer class in the .NET framework is for and how it relates to IDesignerHost? Can someone explain? ...

Silverlight data-binding - is it possible to temporary suspend

Hi I have a group of Siverlight elements that are bound to an object. I want to be able to suspend the databind (effectively freeze their current values) for some time (when the mouse hovers hover the containing panel). What's the best way to do this? There doesn't seem to be an easy way - one thought is to create a copy of the data ob...

VSTO, Outlook.exe.config, and <supportedRuntime>

I've created a VSTO 2.0 SE add-in for Outlook 2007. Usually, it installs no problem on end-users' machines, but sometimes they have an outlook.exe.config file next to Outlook.exe which specifies that only .NET 1.0 or 1.1 is allowed to load. For example: <?xml version="1.0" encoding="utf-8"?> <configuration> <startup> <supportedR...

why is the second DatabaseConflictException being thrown?

I have some linq2sql stuff which updates some rows. Then when I submit I do this: try { database.SubmitChanges(); } catch (ChangeConflictException) { database.ChangeConflicts.ResolveAll(RefreshMode.KeepChanges); database.SubmitChanges(); } Now the second submit(the one in the catch) is throwing yet again a ChangeConflictEx...

Passing parameters from android to .net web service

Hi, Im using ksoap2 to call web .net services. The call works just fine except when I pass paramaters. The passed paramaters are always recieved as null values by the web service. I dont know what the problem is, I hope someone can help. Thanks, ...

Updating relative time with WPF DataTemplate

Hi! I'm using a DataTemplate to show items (from a class via data binding) in a listbox. This class also contains date and time, and I'm using a converter to convert this date/time to relative time (xx minutes ago), which is then displayed in a TextBlock. So far everything is great. The problem is that I don't know how to keep this rela...