.net

User control added dynamically to a WinForm doesn't fire its inner controls events

I have a user control which has several radiobuttons and buttons... I have code to handle button's click events and radio button's CheckedChange event. After adding this userControl dynamically to a Form panel, I notice the events of the inner controls are not firing. I'm doing a "new" of the user control, and adding it to the Controls...

can we use C#.NET to consume a VB dll (API).

Hi, Hi i have a requirement where i have to use a tools API which is VB dll and i have to do some insert ,delete and update using that API. Can i use C#.net to implement these functionalities.If i use vb dll as reference and use thode API's will i face any issue ? ...

WinForms Cursor disappears in (some) textboxes!?

Helly guys! Currently i have the following problem: on a WinForms-Mask there are some textboxes. For some of the textboxes i use the Event "TextChanged" to check if the textbox-content reaches its "MaxLength" AND the cursor is at the end of the textbox. It's one handler for all the "TextChanged" textboxes. The problem: as soon as i cli...

How to create Window's Security Editor dialog in C#?

Is there a way to create Security Editor dialog using C#, similar to CreateSecurityPage() method available in aclui.dll? ...

Initialization code in a WinForms App - Program.cs or MainForm?

I have a Windows Forms application that currently loads a database on startup. The flow is like this: Program.cs => Application.Run(new MainForm()); => MainForm Constructor => Open Database So basically MainForm holds all the bits and pieces that make the application run, while Program.cs is just a stub. Currently, the name of the data...

c# window application: "MyApplication.vshost.exe" Continous comming at task manager

Hi, In my c# windows application whenever i open my solution in visual studio 2008, than "MyApplication.vshost.exe" is always visible at window task manager--> Process tab. When i tried to kill that, it again reappear at Process tab. I am not getting for what vshost.exe created? and why its not getting removed from task manager? How ca...

How to associate permissions available for a user using a security descriptor?

How to associate permissions available for a user using a security descriptor? Given a user how to decide whether the user is having particular permission with the help of security descriptor? ...

How to define Conditional compilation symbols in separate file (not .csproj or app.config)

We need to define a conditional compilation symbol in a class library project. This should not be checked in the source control (it doesn't apply to all developers), so it should be defined in someplace other than the .csproj or the app.config file. How can this be achieved? ...

Any decent ADO.NET Helper utils out there?

Hi all, I am looking for some decent ADO.NET helper utility class to allow me to query an ado.net datasource. I am not looking for anything too fancy, but it has to support transactions. Is there anything out there? P.S. I know the data access block will do that but I was looking for something a bit more independent to other components...

C# Decimal to Numeric(?,?)

Hello! I have a problem, i didn't found yet the solution so i am asking your help. In my database I have some int, decimal and string that needs to be convert in numeric with specific length and precision to include in a flat file. ex: integer 123 to numeric(8,0) ==> 00000123 decimal 123,123 to numeric(8,8) ==> 0000012312300000 String...

Detect local SQL server installation with C#(32 bit as well as 64 bit)

How can I detect if SQL is installed on the local machine using C#? Is it possible to check a remote machine? ...

Can you refactor this ?

Can you refactor this ? private void ClearUserDataFields() { var textBoxes = this.Controls.OfType<TextBox>(); foreach (var txtBoxControl in textBoxes) { txtBoxControl.Text = String.Empty; } } Isn't there anyway to do this in one LOC ? ...

Is there a way to share the same .NET 1.1 web.config file accross IIS5 and IIS7

I am using Vista, but most of the other developers working on the same projects as me are still using XP. Some of our projects have wildcard script mappings for handling vanity URLs, so each time I work on those sites, my IIS 7 adds a system.webServer/handlers section to the web.config file and when one of the other developers do an upda...

Which tests beside unit tests and continuous integration decision?

Some DO facts: two developers in a team we write unit tests (auto run with every build) we use source versioning control system (SVN) we (the two developers) are product managers as well (a classic situation with high risk of product over-engineering) Some DON'T facts we don't have nightly builds we don't have continuous integratio...

How can I get my app to run on Windows Server 2008?

I have created a console application in C# using .NET 2.0. I have tested the application on the 32 and 64 bit versions of Windows Server 2003 and it is working properly. When I tried to run the application on Windows Server 2008, but it doesn't work. Later, someone told me to turn off UAC (User Access Control and Data Execution Preventio...

Can I exploit GPU to do AES encryption from .NET? If so, how?

Interesting paper from Trinity College of Dublin: AES Encryption Implementation and Analysis on Commodity Graphics Processing Units Their technique uses openGL to enlist the GPU to do the numeric transforms required by AES. How difficult would it be to expose this capability - performing stream encryption - via a managed .NET library?...

Optimistic concurrency in ADO.NET Entity Framework

I found an MSDN article that describes how EF handles concurrency when saving changes: By default [...] Object Services saves object changes to the database without checking for concurrency. For properties that might experience a high degree of concurrency, we recommend that the entity property be defined in the conceptua...

Suggestions needed on most efficient way to retrieve an assembly version from an external assembly.

I need to iterate a list of assemblies and determine their version numbers. I've made use of System.Reflection.Assembly.GetExecutingAssembly().GetName().Version before, but in this case I'm working with assemblies that have not yet been loaded. I understand I can use System.Reflection.Assembly.ReflectionOnlyLoadFrom("assembly.dll") but I...

How to keep Font in inherited TextBox?

Hi SO-lers, I'm using the following code to get a TextBox that is not drawing its borders: public partial class CustomTextBox : TextBox { public CustomTextBox() { InitializeComponent(); SetStyle(ControlStyles.UserPaint, true); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); int borderWidth = 1; ...

Is it necessary to override == and != operators when overriding the Equals method? (.NET)

Or it's advisable to do that? Why? ...