¡@

Home 

c# Programming Glossary: not

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

thread operation not valid Control accessed from a thread other than the thread it.. thread which will be loading the data and when done will notify the application that it has done its work. Now came a real.. stage. The Exception it gave was Cross thread operation not valid Control accessed from a thread other than the thread it..

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

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

you are using. Also the OLEDB method is intriguing but may not yield much more than what I can achieve with CSV files. I will.. of the PHP ExcelWriter that you mentioned above. It will not write to the new .xlsx format yet but they are working on adding.. files . There are a few known bugs with each library as noted in the comments. In all EPPlus seems to be the best choice..

How to properly clean up Excel interop objects

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

com interop share improve this question Excel does not quit because your app is still holding references to COM objects... I wasn't aware of it and was the cause why Excel was not unloaded. I found the solution to my problem on this page which..

Encrypt/Decrypt string in .NET

http://stackoverflow.com/questions/202011/encrypt-decrypt-string-in-net

rawLength.Length throw new SystemException Stream did not contain properly formatted byte array byte buffer new byte.. buffer.Length buffer.Length throw new SystemException Did not read byte array properly return buffer share improve this..

Sending email in .NET through Gmail

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

improve this question Be sure to use System.Net.Mail not the deprecated System.Web.Mail . Doing SSL with System.Web.Mail..

Dynamic LINQ OrderBy on IEnumerable<T>

http://stackoverflow.com/questions/41244/dynamic-linq-orderby-on-ienumerablet

expr arg foreach string prop in props use reflection not ComponentModel to mirror LINQ PropertyInfo pi type.GetProperty.. more fun if you want to mix that with dynamic although note that dynamic only applies to LINQ to Objects expression trees..

Why are mutable structs evil?

http://stackoverflow.com/questions/441309/why-are-mutable-structs-evil

So if you change a copy you are changing only that copy not the original and not any other copies which might be around... copy you are changing only that copy not the original and not any other copies which might be around. If your struct is immutable..

Random number generator only generating one random number

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

from different threads which might be a problem and might not. The guarantee of what happens internally is the bigger issue.. internally is the bigger issue though since Random does not make any guarantees of thread safety. Thus there are two valid.. the first and simpler of these approaches however another approach might be private static readonly ThreadLocal Random..

Deep cloning objects in C#

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

And then make changes to the new object that are not reflected in the original object. I don't often need this functionality..

How to use HTML Agility pack

http://stackoverflow.com/questions/846994/how-to-use-html-agility-pack

How do I use the HTML Agility Pack My XHTML document is not completely valid. That's why I wanted to use it. How do I use.. with bodyNode NB This code is an example only and not necessarily the best only approach. Do not use it blindly in.. only and not necessarily the best only approach. Do not use it blindly in your own application. The HtmlDocument.Load..

Can I pass parameters by reference in Java?

http://stackoverflow.com/questions/1068760/can-i-pass-parameters-by-reference-in-java

o private void mutate Object o o Goodbye NOT THE SAME o Will print Hello to the console. The options if you..

confused with the scope in c#

http://stackoverflow.com/questions/1196941/confused-with-the-scope-in-c-sharp

x4. But there's no mention of x that is inside block 1 but NOT also inside another block. Therefore we don't count the inconsistent..

ProcessStartInfo hanging on “WaitForExit”? Why?

http://stackoverflow.com/questions/139593/processstartinfo-hanging-on-waitforexit-why

indefinitely at WaitForExit. Note also this does code NOT hang for smaller outputs like 3KB . Is it possible that the..

How would you do a “not in” query with Linq?

http://stackoverflow.com/questions/183791/how-would-you-do-a-not-in-query-with-linq

c foreach var c in query Console.WriteLine c from The NOT IN clause in LINQ to SQL by Marco Russo share improve this..

XML Serialization and Inherited Types

http://stackoverflow.com/questions/20084/xml-serialization-and-inherited-types

a lot people EDIT One thing I should also add is that I DO NOT want to go down the XmlInclude route.. There is simply too much.. Data get return _data set _data value summary DO NOT USE This is only added to enable XML Serialization. summary.. only added to enable XML Serialization. summary remarks DO NOT USE THIS CONSTRUCTOR remarks public AbstractXmlSerializer Default..

Reflection: How to Invoke Method with parameters

http://stackoverflow.com/questions/2202381/reflection-how-to-invoke-method-with-parameters

object parametersArray new object Hello The invoke does NOT work it throws Object does not match target type result methodInfo.Invoke..

multimap in .NET

http://stackoverflow.com/questions/380595/multimap-in-net

IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.. SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS..

Compare using Thread.Sleep and Timer for delayed execution

http://stackoverflow.com/questions/391621/compare-using-thread-sleep-and-timer-for-delayed-execution

as close to the specified time as possible whereas this is NOT necessarily the intent of Thread.Sleep. As for destroying the..

Combining two expressions (Expression<Func<T, bool>>)

http://stackoverflow.com/questions/457316/combining-two-expressions-expressionfunct-bool

Expression Func T bool and I want to take to OR AND or NOT of these and get a new expression of the same type Expression..

Can a C# thread really cache a value and ignore changes to that value on other threads?

http://stackoverflow.com/questions/458173/can-a-c-sharp-thread-really-cache-a-value-and-ignore-changes-to-that-value-on-ot

changes to that value on other threads This question is NOT about race conditions atomicity or why you should use locks..

.NET String to byte Array C#

http://stackoverflow.com/questions/472906/net-string-to-byte-array-c-sharp

telling you that you need the encodings. You certainly do NOT need to worry about encodings for this. Just do this instead..

Does Entity Framework 4 Code First have support for identity generators like NHibernate?

http://stackoverflow.com/questions/5275306/does-entity-framework-4-code-first-have-support-for-identity-generators-like-nhi

public class Context DbContext Helper for example DO NOT USE IN REAL SCENARIOS private static int i 0 public DbSet MyEntity..

URL Encoding using C#

http://stackoverflow.com/questions/575440/url-encoding-using-c-sharp

Linux accepts it or not.. EDIT It seems that URL encode is NOT what I want.. Here's what I want to do old username mas fenix..

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

this function to connect to a UNC path with authenticaiton NOT to map a drive . This will allow you to connect to a remote..

C# Events and Thread Safety

http://stackoverflow.com/questions/786383/c-sharp-events-and-thread-safety

calls will be received via that event which clearly is NOT achieved by this technique. You'd be concealing a race condition..

Why catch and rethrow Exception in C#?

http://stackoverflow.com/questions/881473/why-catch-and-rethrow-exception-in-c

summarise for anyone who finds this thread in future... DO NOT try do stuff that might throw an exception catch Exception e..

JavaScriptSerializer.Deserialize - how to change field names

http://stackoverflow.com/questions/1100191/javascriptserializer-deserialize-how-to-change-field-names

the following JSON data coming to me from a server API Not coded in .Net user_id 1234 detail_level low I have the following.. serializer.Deserialize DataObject JsonData Assert.IsNotNull dataObject Assert.AreEqual DetailLevel.Low dataObject.DetailLevel.. dataObject serializer.ReadObject ms as DataObject Assert.IsNotNull dataObject Assert.AreEqual low dataObject.DetailLevel Assert.AreEqual..

C# - Correct Way to Load Assembly, Find Class and Call Run() Method

http://stackoverflow.com/questions/1137781/c-sharp-correct-way-to-load-assembly-find-class-and-call-run-method

Should I try casting the TestRunner class to something Not sure how the types in one assembly dynamic code would know about..

Complex UI inside ListBoxItem

http://stackoverflow.com/questions/15532639/complex-ui-inside-listboxitem

to load the UI and only render what's visible on screen Not out of the box but some third party control suites have components.. WYSIWYG documents and other types of rich content No. Not at all. Not even a little bit. In short if it's an acceptable.. documents and other types of rich content No. Not at all. Not even a little bit. In short if it's an acceptable solution I'd..

Embedding JavaScript engine into .NET (C#)

http://stackoverflow.com/questions/172753/embedding-javascript-engine-into-net-c

experience in this area Engines like SquirrelFish V8.. Not that I'm not satisfied with Mozilla's Spidermonkey using it..

Transactions in .net

http://stackoverflow.com/questions/224689/transactions-in-net

try your code tran.Commit catch tran.Rollback throw Not too messy but limited to our connection conn . If we want to.. CallAMethodThatDoesSomeMoreWork tran.Complete Note here that the two methods can handle their own connections..

Do you need to dispose of objects and set them to null?

http://stackoverflow.com/questions/2926869/do-you-need-to-dispose-of-objects-and-set-them-to-null

need it especially if the object uses unmanaged resources. Not disposing of unmanaged resources will lead to memory leaks ...

Is there a better alternative than this to 'switch on type'?

http://stackoverflow.com/questions/298976/is-there-a-better-alternative-than-this-to-switch-on-type

Checkbox is x.Checked TypeSwitch.Default textBox1.Text Not sure what is hovered over The code for TypeSwitch is actually..

Get Enum from Description attribute [duplicate]

http://stackoverflow.com/questions/4367723/get-enum-from-description-attribute

Description attribute from an Enum enum Animal Description NotSet 0 Description Giant Panda GiantPanda 1 Description Lesser.. return T field.GetValue null throw new ArgumentException Not found. description or return default T Usage var panda EnumEx.GetValueFromDescription..

Split a collection into n parts with LINQ?

http://stackoverflow.com/questions/438188/split-a-collection-into-n-parts-with-linq

a nice way to split a collection into 'n' parts with LINQ Not necessarily even of course c# .net linq data structures share..

Enum ToString

http://stackoverflow.com/questions/479410/enum-tostring

of the following values private enum PublishStatusses NotCompleted Completed Error I want to be able to output these values.. the enum private enum PublishStatusses Description Not Completed NotCompleted Completed Error Then use this code to.. private enum PublishStatusses Description Not Completed NotCompleted Completed Error Then use this code to retrieve it public..

Casting vs using the 'as' keyword in the CLR

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

foo TargetType randomObject Do something with foo Not only is this checking twice but it may be checking different.. null Do stuff with convertedRandomObject.Value Note currently this is actually slower than is cast . I think it's.. thought of using a nullable type and as together EDIT Note that none of the above talks about performance other than the..

WPF MVVM Newbie - how should the ViewModel close the form?

http://stackoverflow.com/questions/501886/wpf-mvvm-newbie-how-should-the-viewmodel-close-the-form

and code behind then to use some global command hack. Not everything is a good fit for MVVM. share improve this answer..

Protect .NET code from reverse engineering?

http://stackoverflow.com/questions/506282/protect-net-code-from-reverse-engineering

better instead of trying to stop the inevitable. Not only that but I was hurting my true customers will all these..

When to use struct in C#?

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

or maintaining an instance size of only 16 bytes or less Nothing in the structs above is declared readonly not immutable.. difference if Dictionary is initialized with the Capacity Not enough to be concerned with ... 12ms . What happens is because..

Proper use of the IDisposable interface

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

know whether or not it needs to call DeleteHandle . Note What is an unmanaged resource If you found it in the Microsoft.. your object Then they would leak some unmanaged resources Note They won't leak managed resources because eventually the garbage.. finally gets around to freeing i.e. finalizing our object. Note The garbage collector will eventually free all managed objects...

What is the best workaround for the WCF client `using` block issue?

http://stackoverflow.com/questions/573872/what-is-the-best-workaround-for-the-wcf-client-using-block-issue

original exception is then masked by the second exception. Not good. The suggested workaround in the MSDN article is to completely..

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

I know what might have gone wrong and how do I fix it Edit Not to forget my connection string and connection are both in static...

How can I make a .Net Winforms application that only runs in the System Tray?

http://stackoverflow.com/questions/995195/how-can-i-make-a-net-winforms-application-that-only-runs-in-the-system-tray

do to make a WinForms application run in the System Tray Not an application that can minimize to the tray but one that exists.. share improve this question The basic answer of using a NotifyIcon is correct but like many things .NET there are a host.. How to support dynamic context menus. The standard NotifyIcon exists in WinForms space can I do a pure WPF solution..