¡@

Home 

c# Programming Glossary: doing

How to properly clean up Excel interop objects

http://stackoverflow.com/questions/158706/how-to-properly-clean-up-excel-interop-objects

application is manually closed. Anyone realize what I am doing wrong or has an alternative to ensure interop objects are properly.. with com objects. So with this knowledge the right way of doing the above is Worksheets sheets excelApp.Worksheets the important..

TransactionScope automatically escalating to MSDTC on some machines?

http://stackoverflow.com/questions/1690892/transactionscope-automatically-escalating-to-msdtc-on-some-machines

SQL server actually which will escalate to DTC. We are not doing this in our code we're not using different SQL servers nor different..

When to Use Static Classes in C#

http://stackoverflow.com/questions/241339/when-to-use-static-classes-in-c-sharp

well... Had we created a class with the single purpose of doing what this static method did we could solve this by taking in..

Tips for optimizing C#/.NET programs [closed]

http://stackoverflow.com/questions/2473666/tips-for-optimizing-c-net-programs

squeezed every ounce of efficiency from their code Often doing so while walking 5 miles in the snow In the spirit of bringing.. this. Use string.Compare to compare 2 strings instead of doing something like string1.ToLower string2.ToLower The general consensus..

Why does one often see “null != variable” instead of “variable != null” in C#?

http://stackoverflow.com/questions/271561/why-does-one-often-see-null-variable-instead-of-variable-null-in-c

probably meant if x 5 You can work around this in C by doing if 5 x A typo here will result in invalid code. Now in C# this..

Returning IEnumerable<T> vs IQueryable<T>

http://stackoverflow.com/questions/2876616/returning-ienumerablet-vs-iqueryablet

too many rows from the database. Another prime example is doing paging If you use Take and Skip on IQueryable you will only.. IQueryable you will only get the number of rows requested doing that on an IEnumerable T will cause all of your rows to be loaded..

Implement C# Generic Timeout

http://stackoverflow.com/questions/299198/implement-c-sharp-generic-timeout

void FiveSecondMethod Thread.Sleep 5000 The static method doing the work static void CallWithTimeout Action action int timeoutMilliseconds..

How do you convert Byte Array to Hexadecimal String, and vice versa?

http://stackoverflow.com/questions/311165/how-do-you-convert-byte-array-to-hexadecimal-string-and-vice-versa

ba return hex.Replace There are even more variants of doing it for example here . The reverse conversion would go like this..

Casting vs using the 'as' keyword in the CLR

http://stackoverflow.com/questions/496096/casting-vs-using-the-as-keyword-in-the-clr

not an implementation. What I've found is that I'm doing a lot of casting or object type conversion. What I'd like to.. text Use value That's sort of what is and cast is doing although obviously in a rather cheaper way. share improve this..

Use of Application.DoEvents()

http://stackoverflow.com/questions/5181777/use-of-application-doevents

yourself in the foot if you don't do it right. Easily. And doing it right requires knowing exactly what it does which in the.. problems. Of course no programmer ever actually likes doing this. And doesn't. Which is why you shouldn't use DoEvents ...

C# DLL config file

http://stackoverflow.com/questions/594298/c-sharp-dll-config-file

in a DLL ' this should not be a problem. So obviously I'm doing something wrong... The following code should return my ConnectionString..

Difference between Property and Field in C# 3.0+

http://stackoverflow.com/questions/653536/difference-between-property-and-field-in-c-sharp-3-0

OO design. And if you don't have a very good reason for doing it always choose a property over a public variable field. share..

Random number generator only generating one random number

http://stackoverflow.com/questions/767999/random-number-generator-only-generating-one-random-number

made the outcome even more random but what we are actually doing is potentially breaking the internal implementation and we could..

Is there a way to check if a file is in use?

http://stackoverflow.com/questions/876473/is-there-a-way-to-check-if-a-file-is-in-use

religion so I was wondering if anyone has a better way of doing it c# file io file locking share improve this question I've..

Is there a reason for C#'s reuse of the variable in a foreach?

http://stackoverflow.com/questions/8898925/is-there-a-reason-for-cs-reuse-of-the-variable-in-a-foreach

normal circumstances the only reason I can think of for doing this is if you plan to use the variable outside the scope of..

Mod of negative number is melting my brain!

http://stackoverflow.com/questions/1082917/mod-of-negative-number-is-melting-my-brain

to get an array position so that it will loop round. Doing i arrayLength works fine for positive numbers but for negative..

Conditional Linq Queries

http://stackoverflow.com/questions/11194/conditional-linq-queries

severity if filterByUser logs logs.Where p p.User user Doing so this way will allow your Expression tree to be exactly what..

How to decide between MonoTouch and Objective-C?

http://stackoverflow.com/questions/1583856/how-to-decide-between-monotouch-and-objective-c

that would concern you then Apple's stack wins this one. Doing any XML work MonoTouch. Period. String manipulation Date manipulation..

When to use IList and when to use List

http://stackoverflow.com/questions/17170/when-to-use-ilist-and-when-to-use-list

heterogenous lists because System.Object can be a T too. Doing this will save you headache if you decide to use a Stack or..

Weak event handler model for use with lambdas

http://stackoverflow.com/questions/1747235/weak-event-handler-model-for-use-with-lambdas

e directly if we are inside the Subscriber class. Doing this effectively creates a reference to subscriber which completely..

How do I use LINQ Contains(string[]) instead of Contains(string)

http://stackoverflow.com/questions/194930/how-do-i-use-linq-containsstring-instead-of-containsstring

be better if uid is also int . List T supports Contains . Doing uid.ToString .Contains string would imply that the uid as a..

The need for volatile modifier in double checked locking in .NET

http://stackoverflow.com/questions/1964731/the-need-for-volatile-modifier-in-double-checked-locking-in-net

in his article in the gotchas for double checked locking. Doing one of marking the variable as volatile reading it with Thread.VolatileRead..

C# - Exception messages in English?

http://stackoverflow.com/questions/209133/c-sharp-exception-messages-in-english

beforehand and restoring it immediately afterwards . Doing this on a separate thread is even better this ensures there..

Comparing strings with tolerance [closed]

http://stackoverflow.com/questions/2344320/comparing-strings-with-tolerance

for a way to compare a string with an array of strings. Doing an exact search is quite easy of course but I want my program..

why do we need the new keyword and why is the default behavior to hide and not override?

http://stackoverflow.com/questions/3117838/why-do-we-need-the-new-keyword-and-why-is-the-default-behavior-to-hide-and-not-o

behaviour of code that was compiled to use base classes. Doing something dangerous like making an override should be something..

Sending email in .NET through Gmail

http://stackoverflow.com/questions/32260/sending-email-in-net-through-gmail

use System.Net.Mail not the deprecated System.Web.Mail . Doing SSL with System.Web.Mail is a gross mess of hacky extensions...

How do I use IValidatableObject?

http://stackoverflow.com/questions/3400542/how-do-i-use-ivalidatableobject

the result collection which is an indication of success. Doing the validation public void DoValidation var toValidate new..

How to do joins in LINQ on multiple fields in single join

http://stackoverflow.com/questions/373541/how-to-do-joins-in-linq-on-multiple-fields-in-single-join

from key to a sequence of entries matching that key. Doing that with date ranges is somewhat harder. However depending..

Fastest way to interface between live (unsaved) Excel data and C# objects

http://stackoverflow.com/questions/3840270/fastest-way-to-interface-between-live-unsaved-excel-data-and-c-sharp-objects

to read an array of values from a range in one step. Doing this and then looping through the values within the array is..

How can I customize the system menu of a Windows Form?

http://stackoverflow.com/questions/4615940/how-can-i-customize-the-system-menu-of-a-windows-form

want to do is add an item or two to the end of the menu. Doing anything more advanced like inserting an item in the middle..

C# Audio Library [closed]

http://stackoverflow.com/questions/466458/c-sharp-audio-library

convert audio files between the formats would be handy. Doing a google search I came across the alvas.audio library but it..

StructureMap Auto registration for generic types using Scan

http://stackoverflow.com/questions/516892/structuremap-auto-registration-for-generic-types-using-scan

typeof IRepository Doing it this way avoids having to create your own ITypeScanner or..

Function profiling woes - Visual Studio 2010 Ultimate

http://stackoverflow.com/questions/5525758/function-profiling-woes-visual-studio-2010-ultimate

not recommend doing so here. Take a look at the Functions Doing The Most Individual Work on the summary view. This displays..

How is Math.Pow() implemented in .Net Framework?

http://stackoverflow.com/questions/8870442/how-is-math-pow-implemented-in-net-framework

on pow though Microsoft purchased that code from Intel. Doing a better job than the Intel engineers is unlikely. Although..

How to make a property protected AND internal in C#?

http://stackoverflow.com/questions/941104/how-to-make-a-property-protected-and-internal-in-c

name with that I_ prefix. But it's kind of a weird design. Doing some kind of name mangling on the internal property is a way..