.net

Loading dlls from gac is blocking app

The last few months my application grew bigger and bigger. It's runnable as Wpf .EXE and XBAP at the moment, both sharing the same code. At a few points in the application, the application locks. After invertigating I found out that the application is loading dlls from the GAC at these moments. What happens is that the application star...

LINQ Query to insert data into the database.

Hi all, In my database, I have a table named Students, with 3 Columns (SNo, SName, Class). I want to insert the value of only SName. Can anybody tell me how to write the LINQ Query for this. Thanks, Bharath. ...

What type of object should I be binding to my WPF form in an n-tier app?

I am currently working on a small N-Tier application in C# which uses Linq-to-Entities (SQL Express 2005 for the DB) and WPF and I am wondering what type of data collection my business logic layer should be supplying to the user interface. Are there downsides (performance, validation etc) to binding form objects like datagridviews to an...

combobox in vb.net

how to hide or disable items in one combobox on the basis of selected item in another combobox in vb.net? ...

Breaking an interface

What are the most important guidelines to follow if you need to break an interface in a .NET application? How do these guidelines change before and after your application has been deployed? I know there are other questions that debate when/where interfaces should be used, however I don't want to get into that. I just want to know some ...

What is an "async IO operation" in .NET?

To cut a long story short - read this article first and then this article. In short - it's the old issue about ASP.NET and randomly switching among threads. Well, not so randomly actually. As the second article explains, this only happens "when your thread performs an async IO operation". So... what the heck is an async IO operation in t...

User images - database vs. filesystem storage

I’m writing an upload function in .NET for presentation images on user profiles. I’m choosing between two different ways of doing it, and would like to ask on advice and opinions as to the pros and cons. Store the images directly on the file system Store the images in the database So far I’ve been mostly pro the first option – naming...

How to preserve project settings between program executions?

In my application I allow user to choose a file with some data, data is read and it should be available when user closes and opens the application again. I thought that one could store the value in Settings so I wrote a class: public static class SettingsManager { public static string ComplexValidationsString { ...

Trying to store password to database...

Hi i'm doing a test how hash and salt passwords. Well , i can add hash and salt password to the Database but i got stuck to store passwords from database. i have a simple Database : Table _______ ProvaHS -------...

running msbuild without having VS installed

Hi, I'm trying to run msbuild on a solution that has some C++ code in it. I have the SDK installed but not Visual Studio. I get the following error: error MSB3411: Could not load the Visual C++ component "VCBuild.exe". If the component is not installed, either 1) install the Microsoft Windows SDK for Windows Server 2008 and .NET Framew...

Extracting Data from a dataset returned from a web service

Hi All, Has anyone a source of the qury language used to extract data returned from a web service. I wrote a web service returnes a dataset, [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP...

STEP/EXPRESS tools for .NET

Hi, Has anyone had any experience with using the STEP and EXPRESS formats in a .Net environment? I am looking for a tool that will generate a c# class structure based on an EXPRESS schema. I would also like the tool to create a parser/file generator for importing and exporting to STEP-files. Does anyone know of a tool that does this? ...

How to generate PDB's for .net managed projects in release mode?

I know PDBs are generated for managed projects in .NET by giving the compiler the /debug argument. Is there a way to specify this in the VS (2005) GUI? The only way I could get it to generate PDBs in release mode so far is to manually modify the .csproj file and to add : <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> ...

How does CLR know to make copy of parameters(precisely objects) ?

When we call any method that's outside the machine boundaries ( remote methods ) , how does the CLR know this and then serialize ( or make copies of ) actual objects and not the memory addresses ( references to the actual objects ) to send when any method is called crossing the machine boundaries ? This question came to my mind realizin...

Should NullRefs ever be caught?

I recently made the statement to a colleague that: NullReferenceExceptions should never be explicitly caught I used the word never.... hmmm. I've never seen a appropriate use case myself for catching them but I wanted to check if anyone else has? Never is such a strong word after all..... ...

How to create an XmlMappingSource during runtime?

(Follow-Up-Question to How to change LINQ O/R-M table name/source during runtime?) I need to change the table source of a LINQ 2 SQL O/R-Mapper table during runtime. To achieve this, I need to create an XmlMappingSource. On command line, I could use SqlMetal to create this mapping file, but I would like to create the mapping file during...

Is this is a bug in .net Monitor/lock statement or does MessageBox.Show behaves differently?

Imagine you have two buttons on the win form. What do you think should be the behavior when user presses the "button 1" with the below code? Should it display all 5 message box in one go, or one by one - MessageBox.Show statement is inside a lock statement? public partial class Form1 : Form { public Form1() { Initializ...

What is the best exception handling strategy within error logging classes?

I am writing an error logging set of classes which will log to file, event log etc. What exception handling should be performed within these classes? For instance, say I have a LogError method, which is called from exception handlers, and writes to file. What is considered the best thing to do, should an error occur? Obviously, I should ...

Equivalent to Marshal.PtrToString* methods for byte array

If I have an unmanaged pointer and I want to transfer a specified number of bytes from that location to a Byte array, what is the best way to do this? i.e. what is the equivalent of Marshal.PtrToString* methods but where the destination is a Byte() Thanks ...

When writing code for an event from a control, should I cast object or reference it explicitly

If I am writing code to handle an event from a control on a form as follows: private void btnButton_Click(object sender, EventArgs e) { Button btn = (Button)sender; btn.Text = "Button pressed" } Should I always cast the sender object to its correct type (as I'm doing above), or is it better to explicitly reference t...