.net

BinaryFormatter picking up events

I have a storage class that has events on adding items to it. My form class handles the event. When I try to serialize it, formatter complains about form class not marked as serializable. Of course, I don't want to serialize it, however, i can't mark event as [NonSerialize] since it is not field... What to do? EDIT: Aditional info: ...

Good C# open-source projects to participate in?

I'm looking for some large open-source .NET (especially C#) projects to participate in as a developer, I'm interested in both web and desktop applications. I want the project to have a large number of members to get the feeling of working with a team. Thanks for your suggestions. Related: Open source C# projects that have high code...

Is there a way to use System.Transactions with connection pooling?

I think the System.Transaction classes in Framework 2.0 are a great tool, well designed, aimed to simplify code when working with transactions. But, (big but), it's impossible to use those classes with multiple connections to the same database (same connection string) without promoting to distributed transactions. http://social.msdn.m...

Do I have to unit-test classes without specific functionalities?

I am learning about unit-testing best-pratices (especially thanks to this post : What makes good unit-test?), because during my project we started to make unit-tests in a bit anarchic way. So now I have to get almost everything from the start to apply strong testing method. One question the quoted post did not answered was do I have to ...

how to make Int1024

how to declare int1024 in C#? i can use VB or C++ Too. Regards Behrooz ...

In which language is each Mono component developed?

According to Wikipedia, Mono has three main components: Core components Mono/Linux/GNOME development stack Microsoft compatibility stack I want to know what the language or technology each one of those components is developed in. EDIT: I know that the some portions of the project is developed in C#, especially the old ones, but I ...

(WPF) UI best practices

Hi, we are curring analyzing whether to implement a solution for a software application by using either WPF or WinForms. Apart from that decision, I just wanted to ask whether someone of you has good resources in terms of UI design (i.e. layout) (papers, case studies, links, books...), preferably targeted to WPF. I do not necessarily ...

Build C# Projects and their dependencies

In VS2005 I have a few C# projects that depend on each other. If project A depends on B (e.g. references it), then I want B to build whenever I build A, assuming B has changed in some way since last built. That's the way it is with VC projects, but for some reason it doesn't seem to work with C# projects. If I clean B and then build A i...

Creating a valid string from a regular expression

Hello, In the application I am currently working on, I have an option to create automatic backups of a certain file on the hard disk. What I would like to do is offer the user the possibility to configure the name of the file and its extension. For example, the backup filename could be something like : "backup_month_year_username.bak"...

ASP.Net Web Site Administration Tool Link

I'd like to include the ASP.net Web Admin tool in a web site when a user logs in as an local manager of the web site, this will be on the LAN and not public. I can obtain the link in Visual Studio ie http://localhost:54397/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=D:\DATA\Projects\WebIV\WebSite\&applicationUrl=/WebS...

Problem when adding ComboBox to DataGridView .

Hi everyone, I have a DataGridView with custom columns. But when i add a "DataGridViewComboBoxColumn" and give to it a list with my custom class as datasource then i had the following error: The following exception occurred in the DataGridView: System.ArgumentException: DataGridViewComboBoxCell value is not valid. New EDI...

Is it possible to iterate through method's parameters in C#?

I've been thinking that it would be useful to be able to do such a thing, for example, to check the parameters for null references and eventually throw an exception. This would save some typing and also would make it impossible to forget to add a check if a new parameter is added. ...

Can a referenced DLL be loaded even if it's not called?

Env.: .NET / VS2008 Hi All, My app uses a 3rd party DLL assembly separately installed on some systems (clearly identified) but not all of them. Which means that on some systems, the DLL is not there hence must not be called. To solve this, I have 2 versions of the app (using 2 configurations) for the 2 use cases. In one of them, all ...

How to prevent access violation on unmanaged dll call?

We have inherited a legacy system for reading to and from meter guns. This system was originally build on XP with .Net 1.1 (VS2003?). Having recompiled it on VS2008 with .net 3.5 we get an access violation when calling the dll (dll not touched). The original program (using basically the same code) is running fine on our production machin...

Multiple queries using one SqlCommand possible?

Is it possible to add multiple queries to the SqlCommand object in .net? And if one of the queries fails and the rest succeeds, does the command report this as a failure or succes? last question: can the queries share the same parameters? So, is this possible: UPDATE mytable SET column1 = @param1 WHERE recid = @recid; UPDA...

CS0103: The name 'xyz' does not exist in the current context

I've created the following function backend: public string getImageURL() { return "some text"; } Within my FormView , I have the following code; <img class="hotelImage floatLeft" src="<% getImageURL(); %>" alt="" /> But I keep getting the CS0103: error. Why is that? I'm pretty sure I've called lots of functions this way in the ...

Decrypting PKCS#7 encrypted data in C#

I am working on a solution that needs to decrypt PKCS#7 encrypted data, preferably in C#. As far as I can see, the .NET api has support for this through the System.Security.Cryptography.Pkcs namespace. However it seems that the implementation can only work on byte arrays. So what do I do when I have a large encrypted file that does not f...

How shoud I implement an application-wide color-code in a WinForm application ?

I'm building a WinForms application, and I'm using specific colors on most controls. I do that sometimes from the WinForms designer, and sometimes directly into my code. I got a static class somewhere looking like that : public static class MyColors { public static Color DarkGreen = Color.FromArgb(0, 70, 62); ... ...

Resizing images

Is there any convenient way of resizing image with C#? ...

Integrating with Calendars - From database application

We develop a small business database application with PowerBuilder. Part of the functionality includes scheduling appointments (a secretary schedules an appointment for her doctor via our application). The scheduling appointment is stored as a database record and viewable/editable via our application. Pretty standard stuff. We would...