.net

Custom RoleProvider with MVC 2.0

I have a custom Membership and Role Provider that I am setting up within an application. In ASP .Net Webforms I utilize the same providers and when the app is compiled and run the providers are initialized because of the references in the web.config. When I move this to MVC and put break points in my "Initialize" methods for these cl...

Printing in .Net

I am printing out a Gridview along with a Title. I don't print anything else on the page. That works fine. However I have a cell that is a template field that i do not want to Print. How can I exclude that cell? Here is some code that I have. <div id="Printmeonly" align="center"> <table width="100%"> <tr id="trtitle" style="display:...

.NET IDisposable inline temps

I use code rush and refactor pro (highlight possible code issues and so on like ReSharper) and they were telling me I had undisposed locals (that implemented IDisposable). So I changed the code to this with two using statements: using (Reports.StudentRegisters.StudentQueriesDataTable studentDataTable = new Reports.StudentRegisters.Stude...

.Net Framework v3.5, Service Pack 1 for windows 7

When i try to install .Net Framework v3.5, Service Pack 1 on my PC wich have a windows 7 os an error message tels me that there is a compatibility probleme. How can do to execute this installation??? ...

Csharp Application Not starting minimizied

Hey Guys, I've built a csharp app that I want to start just in the notification area. The icon appears when it is run, and it does not appear in the task bar (due to ShowInTaskbar = false & WindowState = Minimized). However when it first runs I can still alt-tab to it. Is there anyway to prevent this behaviour? Or have I missed a settin...

C#: Rename file using File.Move give IOException

I am writing a simple application that will rename JPEGs with the date/time they were taken before the current filename. This is so that I can combine all the photos that I took with those of my partner (different camera makes and filenames). The following piece of code is where the failure occurs: private void RenameFile(String oldFil...

New item field on top of DataGridView

DataGridView in .Net has built-in support for adding new items at the bottom. Last row is treated in a special way. The IBindingSource interface supports this through AddNew/EndNew/CancelNew methods. Is it possible to change this to allow adding items in the top row of the grid instead? I know I can do sourceList.Insert(0, item) progra...

Why does Castle Windsor constructor crash on Windows Server 2003 with a manifest?

As part of getting our application ready for Windows7, we recently added a manifest to our our user interface's exe. It runs ok on Windows7. However, now when I try to run the signed exe on Windows Server 2003, the program crashes during startup. I've looked at the crash dump, and it seems to by failing in the constructor of Castle.Core...

How can I debug a crash-on-exit of a .NET add-in to a native application?

I've got a .NET plugin (written in C# & VB.NET) exposed via COM and loaded into an application built using native code (C++). We're working on a 64 bit compatibility release, and when the application exits we're seeing a crash screen from the application. If I run the application from a Visual Studio debug session the crash isn't cau...

SQL Server xQuery return NULL instead of empty

So in this example I'm trying to return a NULL instead of an empty nvarchar for element2 and element3. I can't seem to find an answer to this anywhere, or if it's even possible. I know I can check .exists() with a nullif of Case/When, but I'd rather not make that check for the sake of performance. WqlEventQuery query = new WqlEventQue...

Static Linking of libraries created on C# .NET

Hello, I'm using VS2008 C#.NET. I created 3 different classes of libraries in 3 projects. I wrote an application which uses these libraries (dlls). What is happening is each project is compiling into a class library. So, I've 3 dlls and 1 exe. Instead I want to have these in two ways: Only class library assembly (dll) which contain...

Generics and Functions in C#

Here is some code, it won't compile but essentially want I want to create is a function that parses as CSV file and then converts the values in the CSV list to a specific type. Func<string, Func<string,T>, IEnumerable<T>> parser =(string csv, Func<string, T> newFunc) => { List<T> items = new List<T>(); string[] a...

ProAspCompLib.dll - what is this for?

Trying to dissect a very badly written ASP.NET app. Can someone tell me what this assembly (ProAspCompLib.dll) is used for? ...

How to call explicit interface implementation methods internally without explicit casting?

If I have public class AImplementation:IAInterface { void IAInterface.AInterfaceMethod() { } void AnotherMethod() { ((IAInterface)this).AInterfaceMethod(); } } How to call AInterfaceMethod() from AnotherMethod() without explicit casting? ...

Exporting WSDL/XSD schemas for data contract types with IXmlSerializable

I'm creating a WCF service which I want to consume from a Java app. But the question isn't about .net-java interop. The key point is one of types related to a service operation is IXmlSerializable. That type return its XSD schema with static method referenced by XmlSchemaProviderAttribute. The problem is when we get wsdl for the service...

add ajaxtoolkit to toolbox

How do I show the ajax tool kit in my toolbox in .net? All i see are the ajax server side extensions. ...

Need to show something when item on CheckBoxList is clicked

Hey there, i got this very annoying problem: I have a CheckBoxList getting items from a datasource with it's values and all. What I need is to show some panel when Item with value "33" is Checked. So I Need to get the Clicked Item, Last Clicked, or something... I tried a lot of ways and it just won't work... None of the following 3 lines...

Regex for splitting

I'd like to split a string such as "[1-5]?3456[2-5][4-D]" to array[0] = "[1-5]" array[1] = "?" array[2] = "3" array[3] = "4" array[4] = "5" array[5] = "6" array[6] = "[2-5]" array[7] = "[4-D]" Can anybody tell me if that's possible with a regex that splits? I got three elements "3" a letter (which can be 1-9 and A-F, "?" a whiteca...

unclipped Winforms user controls ?

Hi All, Is it possible to create a form with controls allowed to draw outside their (client) area? In WPF, this is not only possible but it's even the default: ClipBounds = false;. How can I do the same in WinForms? TIA, ...

Mono Resources for Cross Platform Development

Is there a site or repository of information about Cross Platform development in mono? Obviously I know about Moma, and the Cross Platform Guidlines and I am using the Visual Studio Tools to run and debug applications in a Virtual Machine, however since I am migrating an old application I have dozens (if not hundreds) of PInvokes to mig...