¡@

Home 

c# Programming Glossary: don't

Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on

http://stackoverflow.com/questions/142003/cross-thread-operation-not-valid-control-accessed-from-a-thread-other-than-the

by the parent thread and not the third that I spawned. I don't know whether I perceived this right or wrong. I'm new to threading... into a global variable based on the value of a control. I don't want to change the value of a control from the child thread...

Create Excel (.XLS and .XLSX) file from C# [closed]

http://stackoverflow.com/questions/151005/create-excel-xls-and-xlsx-file-from-c-sharp

Spreadsheet with C# Ideally I would like open source so I don't have to add any third party dependencies to my code and I would..

Deserialize JSON into C# dynamic object?

http://stackoverflow.com/questions/3142495/deserialize-json-into-c-sharp-dynamic-object

for debugging. You can drop the two methods out if you don't want them as they aren't required for deserialisation. EDIT..

Casting vs using the 'as' keyword in the CLR

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

question. c# casting clr share improve this question I don't think any of the answers so far at the time of starting this.. more elegant and consistent but there we go. If you really don't need the converted value but you just need to know whether it..

Use of Application.DoEvents()

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

really explains why it is bad . The same kind of wisdom as don't mutate a struct . Erm why does the runtime and the language.. so bad Same reason you shoot yourself in the foot if you don't do it right. Easily. And doing it right requires knowing exactly..

When to use struct in C#?

http://stackoverflow.com/questions/521298/when-to-use-struct-in-c

a reference type IEnumerator is returned. What we don't see here is any attempt or proof of requirement to keep structs..

Proper use of the IDisposable interface

http://stackoverflow.com/questions/538060/proper-use-of-the-idisposable-interface

it What if there's an open database connection Surely we don't want that connection sitting open waiting for the GC to finalize.. do this by overriding the Finalize method. Note In C# you don't explicitly override the Finalize method. You write a method.. see the garbage collector runs on a background thread you don't know the order in which two objects are destroyed. It is entirely..

Random number generator only generating one random number

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

Thus there are two valid approaches synchronize so that we don't access it at the same time from different threads use different..

Deep cloning objects in C#

http://stackoverflow.com/questions/78536/deep-cloning-objects-in-c-sharp

object that are not reflected in the original object. I don't often need this functionality so when it's been necessary I've.. it into a fresh object. The benefit is that you don't have to concern yourself about cloning everything when an object..

How do I access ARP-protocol information through .NET?

http://stackoverflow.com/questions/1148778/how-do-i-access-arp-protocol-information-through-net

Time to live 0 reply.Options.Ttl Console.WriteLine Don't fragment 0 reply.Options.DontFragment Console.WriteLine Buffer..

Easier way to start debugging a windows service in C#

http://stackoverflow.com/questions/125964/easier-way-to-start-debugging-a-windows-service-in-c-sharp

When that line is reached it will drop me back to VS. Don't forget to remove that line when you are done. UPDATE As an alternative..

Set focus on textbox in WPF from view model (C#) & wPF

http://stackoverflow.com/questions/1356045/set-focus-on-textbox-in-wpf-from-view-model-c-wpf

e var uie UIElement d if bool e.NewValue uie.Focus Don't care about false values. Now in your View in XAML you can bind..

How to bind to a PasswordBox in MVVM

http://stackoverflow.com/questions/1483892/how-to-bind-to-a-passwordbox-in-mvvm

just get it out and ship it to the server ASAP. Don't keep the value of the password around and don't treat it as.. don't treat it as you would any other client machine text. Don't keep clear text passwords in memory. I know this breaks the..

Custom Compiler Warnings

http://stackoverflow.com/questions/154109/custom-compiler-warnings

by ObsoleteAttribute on the fly too which is very useful. Don't mean to be unhelpful just wondering why you're not keen on using..

Dependency Inject (DI) “friendly” library

http://stackoverflow.com/questions/2045904/dependency-inject-di-friendly-library

Principle The Hollywood Principle in DI terms says Don't call the DI Container it'll call you . Never directly ask for..

Parsing CSV files in C#

http://stackoverflow.com/questions/2081418/parsing-csv-files-in-c-sharp

gritty details for you Check out FileHelpers and stay DRY Don't Repeat Yourself no need to re invent the wheel a gazillionth..

Best Practice: Initialize class fields in constructor or at declaration?

http://stackoverflow.com/questions/24551/best-practice-initialize-class-fields-in-constructor-or-at-declaration

c# java share improve this question My rules 1. Don't initialize with the default values in declaration null false..

What are the differences between delegates and events?

http://stackoverflow.com/questions/29155/what-are-the-differences-between-delegates-and-events

What are the differences between delegates and an events Don't both hold references to functions that can be executed c# events..

Reading csv file

http://stackoverflow.com/questions/3507498/reading-csv-file

the link link text c# csv share improve this question Don't reinvent the wheel. Take advantage of what's already in .NET..

Casting vs using the 'as' keyword in the CLR

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

answer have really explained where it's worth using which. Don't do this Bad code checks type twice for no reason if randomObject..

How can I insert an image into a RichTextBox?

http://stackoverflow.com/questions/542850/how-can-i-insert-an-image-into-a-richtextbox

data which you can insert in the RTF code of a document. Don't forget the closing Next you get the RTF code from your RichTextBox..

Very slow compile times on Visual Studio 2005

http://stackoverflow.com/questions/55517/very-slow-compile-times-on-visual-studio-2005

Disable scanning the directory where your sources reside. Don't do anything stupid. Store and build the Chromium code on a second..

Accessing a Shared File (UNC) From a Remote, Non-Trusted Domain With Credentials

http://stackoverflow.com/questions/659013/accessing-a-shared-file-unc-from-a-remote-non-trusted-domain-with-credentials

when the user attempts to access a shared file. Don't use remote file sharing. Use FTP or some other means to transfer..

POCO vs DTO

http://stackoverflow.com/questions/725348/poco-vs-dto

POCO should be used in the same context in .Net. Don't let frameworks dictate your object's design. A DTO's only purpose..

Deep cloning objects in C#

http://stackoverflow.com/questions/78536/deep-cloning-objects-in-c-sharp

ArgumentException The type must be serializable. source Don't serialize a null object simply return the default for that object..

How can I strip HTML tags from a string in ASP.NET?

http://stackoverflow.com/questions/785715/how-can-i-strip-html-tags-from-a-string-in-asp-net

regex as well. Replace ^ with the empty string globally. Don't forget to normalize the string afterwards replacing s r n with..

ExecuteReader requires an open and available Connection. The connection's current state is Connecting

http://stackoverflow.com/questions/9705637/executereader-requires-an-open-and-available-connection-the-connections-curren

idea in terms of peformance nor in terms of fail safety. Don't poach on the Connection Pool's territory There's a good reason.. requires an open and available Connection . Conclusion Don't reuse connections or any ADO.NET objects at all. Don't make.. Don't reuse connections or any ADO.NET objects at all. Don't make them static shared in VB.NET Always create open in case..