.net

Caching for a single property or method in .NET

Using VB.NET on this one, in ASP.NET Web Forms. I have a property that reads a list from a database over the entity framework, as follows: Public ReadOnly Property MyProperty As List(Of MyType) Get Using service As New MyDatabaseService Return service.GetMyTypeList() End Using End Get End Property ...

What if any links exist to free Excel "helper" class libraries for C#?

I'm looking for any available free Excel "helper" classes that are written for .net (doesn't have to be C#). I'd like to evaluate what others consider to be useful and generic static (and non static) helper methods. Can be targeted at VSTO or regular Office automation, although that probably doesn't matter. I guess I should also point o...

Bind to a sorted ObservableCollection<T> in a ListBox

I have a list of data objects in my Windows Phone 7 application called MyObjectList which inherits ObservableCollection<MyObject>. I keep the list in memory in a public property of App called MyObjects. My goal is to bind the data to a ListBox and have it sorted by MyObject.Name. Currently, I have a ListBox in XAML with the name MyObj...

Examples of IQbservable

I am trying to come up with some good examples of IQbservable usage and thought I'd ask if anyone has used it yet, or has any ideas for how it might be used or abused? EDIT This (IQbservable) is not a typo! (See comments) ...

how do I check if an entity is the first element of a foreach loop

Say I have a foreach loop. I have to do something with the first object of the loop that I don't have to do with any of the other objects. How do I check if the item that's currently in the loop is the first object. ...

Program runs differently when I step into and when I setp over a function in debug mode

I have a function GetAlertData() that returns a Datatable. I invoke it as: var dt = GetAlertData() Behavior in debug mode: Case 1: When I do F11 all the time and go into the GetAlertData function, all works well and I get the correct table Case 2: When I do F10 on this function and step over it, GetAlertData returns a table with all...

invoking MSIEXEC within a Process fails

I have the following piece of service code to install a group of MSI files copied to a given directory: private void InvokeInstallersIn(string path) { var di = new DirectoryInfo(path); foreach (FileInfo fileInfo in di.GetFiles("*.msi")) { try { ProcessStartInfo star...

doing pInvoke and can't get the right hDC

So I'm trying to get the right Device Context so I can set the gamma ramp on individual monitors in an N monitor configuration (2+). I've tried [DllImport("gdi32.dll")] static extern IntPtr CreateDC(string lpszDriver, string lpszDevice, string lpszOutput, IntPtr lpInitData); With this method I'm using the string "DISPLAY" for lpszDr...

Programmatically verifying a Web Reference matches an end point in .NET 3.5

I'm in the unfortunate situation where I need to consume web services that do not have a contract defined, as per normal SOA practices. This means that I need to guard against changes in the web services that break my web references. In the past, breaking changes in new web services versions such as the alteration of enumeration values h...

License for application

Using mysql, c#.net, Java Script I have the web application, i want to create a user limit for my application which means i have to use some license for the users.... For Example customer need the application for 3 users, so application will work for 3 users, if customer need to extend the user from 3 to 10 means, i have to provide a ...

Delete unused files

Hi. My project contains many JavaScript files. many of them are not needed. and there is no reference from them on my project. is there any way or tool for removing them from solution automatically on Visual studio 2010? ...

How to judge the work involved in migrating a website from ColdFusion to .NET

I am trying to judge the work involved in migrating our website from Coldfusion to .NET. At this stage all we want to do is create an exact replica so scope creep should hopefully be avoidable. Does anyone have any suggestions for judging the volume of work required? ...

Use of Assemblycodebase

I have my application bin on some different drive(D:\application\bin). And in my application i do some kind of folder creations(say "Backup" folder) and in this folder i have some files and do some kind of validations. and then after these validations i delete this folder.It had been working well till now.,but now i see that during the p...

Populating a Data Grid in WPF

I need to populate a data grid with information from a table. Can anyone help me out on this problem. ...

Refactor to take either NameValueCollection and KeyValueConfigurationCollection as parameter ?

Example code : EDITED : clarified example. Sorry for any confusion. using System.Collections.Specialized; using System.Configuration; ... // get collection 1 NameValueCollection c1 = ConfigurationManager.AppSettings; // get collection 2 ExeConfigurationFileMap map = new ExeConfi...

ASP.NET CAPTCHA implementation

How can I implement a CAPTCHA in my ASP.NET WebForm? It is a registration form. I am a beginner in ASP.NET, thanks. ...

cache values been seen by other browser user?

A strange issue.. and probably some key thing I am missing... I am using the MS Enterprise Library version 5.0.. specifically the cache engine. I have a website where from a certain page I do the following: Cache some values I need for the next page or two.. Go off to another site - actually a payment site.. That payment site returns...

Lightswitch Evaluation

Has somebody already evaluated the new MS Silverlight RAD tool "Lightswitch"? Is it also suitable for developing complex applications? Can I use it without Silverlight knowledge? Is it so flexible, that I can also extend "Lightswitch appications" with own code (C#,XAML)? ...

Regex to find a file in folder

Hi How to find all files matches a regex pattern in a folder? Thanks ...

How do I debug Windows Forms Designer crashing?

I have a windows forms project. It has a main form derived from System::Windows::Forms::Form which I can open in designer without any problems. If I try and close designer though, it kills Visual Studio (v2008 with SP1). The form includes a tab control which has pages with various System::Windows::Forms::UserControl derived forms. So I'...