.net

Is there any validation control available in .net win forms like asp.net web form?

Is there any validation control available in .net win forms like asp.net web form? Because it difficult to right condition for each control in my from also there are many repeated code in my form. Can u please suggest right way to do this.. ...

Effective file permissions tool's api in windows

Starting from Windows Server 2003, Windows included a new tool which calculates the effective permissions for a user (basically it resolves all groups access and takes care of all "deny" permissions as well). An example in point is that a user A belongs to groups B and C. B has been denied read permissions on a file F, while C has been a...

web browser control from c#.Net crashes after IE 7 upgrade in win XP

I am using C#.Net Web Browser Control to preview some documents. If I use any OS it works fine. After upgrading IE 7 in windows XP SP3, it crashes. This is very strange behavior, not able to find the reason. ...

Memory usage of strings (or any other objects) in .Net

I wrote this little test program: using System; namespace GCMemTest { class Program { static void Main(string[] args) { System.GC.Collect(); System.Diagnostics.Process pmCurrentProcess = System.Diagnostics.Process.GetCurrentProcess(); long startBytes = pmCurrentProcess.Priva...

Getting name of configuration section registered for a certain type in .net

I have a custom configuration section for a library, and I would like to load my configuration object from the library itself. Am I obliged to fix the configuration section group and name, e.g. <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <sectionGroup name="MyGroup"> <section name="MySection" typ...

How to create Bitmap object from a Graphics object ?

How to create Bitmap object from a Graphics object ? I would like to read pixels from my Graphics object. for example, like, System.Drawing.BitMap.GetPixel(). I am trying to find out empty area (all white, or of any colour) inside a pdf document, to write some graphics / image. I have tried like this, but it is not working. why the foll...

Problem with LINQ in C#

I am encountering a problem when using LINQ in C#, I am constantly getting "Specified cast is not valid". This is what I am trying to do. I create a class in which I declare all the columns of the table. [Table(Name="tbl_Aff")] public class Affiliate { [Column] public string name; [Column] ...

Mis-spelling in the .NET configuration system, a design flaw?

I just wrote some .NET code to get connection string from the config file. The config file is as below: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="key1" value="hello,world!"/> </appSettings> <connectionStrings> <add name="conn1" connectionString="abcd"/> </connectionStrings> </conf...

How to use IWindowsUpdateAgentInfo::GetInfo Method

How do I use the IWindowsUpdateAgentInfo::GetInfo Method I have referenced the WUApiLib but I cant find this interface anyhwere ...

List Form controls in a Combobox

[.NET 2] how should I list a form controls in a Combobox of the same form(like VS designer does)? I tried: cboObjectSelection.DataSource = Me.Controls but this does not work. Is there a possibility to filter(customize) this list? ...

Exception from HRESULT: 0x800A03EC

Any help is appreciated: I'm developing a C#.Net app in VS2010 that interacts with Excel. The app works correctly on my local machine. Uploading to a remote Windows 2003 server however, breaks the app. Originally, I received the following message Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-00000...

How can I attach a PDF file stored as binary object in SQL Server to an email?

I'd like to attach a PDF file stored as binary object in SQL Server to an email but without creating a (temporary) file on disk. I already have the first step to pull out the PDF file from the binary field in SQL Server as a byte[] array. Also I have the step to setup the MailMessage: MailMessage aMailMessage = new MailMessage(); // s...

A C# Refactoring Question...

I came accross the following code today and I didn't like it. It's fairly obvious what it's doing but I'll add a little explanation here anyway: Basically it reads all the settings for an app from the DB and the iterates through all of them looking for the DB Version and the APP Version then sets some variables to the values in the DB ...

Properly obsoleting old members in an XML Serializable class in C# VB .NET

Hi! Sometime ago I defined a class that was serialized using XML. That class contained a serializable property Alignment of integer type. Now I have extended and updated this class, whereby a new property Position was added, whose type is another class that also has several serializable properties. The new property Position is now suppos...

Are any major applications using Entity Framework?

I'm investigating the use of Entity Framework in an upcoming project, but I have some concerns about the maturity and market adoption of the product. Are there any high profile web sites or applications using the product? Are there any significant open source projects that have picked it up? ...

How to install vcredist_x86.exe during .NET deployment setup

Hello everyone, I'm trying to install the "VC++ Redistributable 9.0" during my deployment but it always failed. The problem is that this exe (vcredist_x86.exe) is also an installation process and windows does not support nested installation (or I don't know how to make it support it). I'm using a .NET setup project with C#. There is no ...

How to identify whether the objects are just referenced or just copied? .net Memory Management

Hello I'm confused to find whether an object is either copied or the reference of the object is held while equating it to some other objects. Examples int i =5; int j = i; Reference or copy of data? DataSet ds = dsOtherDataSet.Copy(); Reference or copy of data? DataView dvTemp = dsTestDataSet.Copy().DefaultView; What happens h...

WPF DataGrid performance concerns

I am testing WPF DataGrid in hopes of replacing some winforms controls, and so far have been very pleased with the development process. Performance seems to be my biggest concern right now. My development workstation has just about the best cpu on the market running windows 7, with 6 gigs of DDR3 memory. The windows control i am replacin...

RIA Services and forms authentication between services

I've been trying to solve a problem that I really hope someone can help with, or at least point me in the right direction. I've been googling on this for days and just can't quite come up with the answer. Background: I'm using RIA Services to handle communication, validation, etc...from a Silverlight 4 app. I have two domains service...

Advanced Data Server: Problem with an '__error' table in .NET-based stored procedures with parameters

Hey guys! I created .NET-based AEP for ADS v10 beta. Here is a procedure code. .NET side: public int TestSP(int connectionId, int connection, ref int numRowsAffected) { AdsConnection cnn; lock (_connections) cnn = _connections[connectionId]; using (var cmd = cnn.CreateCommand()) { cmd.CommandText = "INS...