c# Programming Glossary: error
How do I enumerate an enum in C#? http://stackoverflow.com/questions/105372/how-do-i-enumerate-an-enum-in-c suit in Suit DoSomething suit It gives the compile time error 'Suit' is a 'type' but is used like a 'variable' It fails on..
Direct casting vs 'as' operator? http://stackoverflow.com/questions/132445/direct-casting-vs-as-operator of functionality with badly designed libraries which use error codes e.g. return null error instead of using exceptions . 3.. designed libraries which use error codes e.g. return null error instead of using exceptions . 3 is not a cast and is just a..
TransactionScope automatically escalating to MSDTC on some machines? http://stackoverflow.com/questions/1690892/transactionscope-automatically-escalating-to-msdtc-on-some-machines it enabled or they get the MSDTC on SERVER is unavailable error message. It's really got me scratching my head and has me seriously..
High Quality Image Scaling C# http://stackoverflow.com/questions/249587/high-quality-image-scaling-c-sharp the correct range if quality 0 quality 100 create the error message string error string.Format Jpeg image quality must.. quality 0 quality 100 create the error message string error string.Format Jpeg image quality must be between 0 and 100 with.. a helpful exception throw new ArgumentOutOfRangeException error create an encoder parameter for the image quality EncoderParameter..
Implement C# Generic Timeout http://stackoverflow.com/questions/299198/implement-c-sharp-generic-timeout tc.DoSomething normally runs in 30 sec. Want to error at 1 min I'm looking for a solution that can elegantly be implemented..
What C# mocking framework to use? [closed] http://stackoverflow.com/questions/37359/what-c-sharp-mocking-framework-to-use have a GetCustomers method I would get a compile time error. I'd also get one if the GetCustomers method didn't return a..
Best practices for exception management in Java or C# http://stackoverflow.com/questions/409563/best-practices-for-exception-management-in-java-or-c-sharp Java you would just handle the exception one. Follow the error management constructs associated with the language c# java.. associated with the language c# java exception error handling share improve this question It seems odd to me that.. to me that you want to catch exceptions and turn them into error codes. Why do you think the caller would prefer error codes..
Cross-thread operation not valid [duplicate] http://stackoverflow.com/questions/5037470/cross-thread-operation-not-valid it was created on Okay I know why this is giving me this error Cross thread operation not valid Control 'Form1' accessed from..
The entity cannot be constructed in a LINQ to Entities query http://stackoverflow.com/questions/5325797/the-entity-cannot-be-constructed-in-a-linq-to-entities-query Product Name p.Name The code below throws the following error The entity or complex type Shop.Product cannot be constructed..
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 wrapping a WCF client in a using block could mask any errors that result in the client being left in a faulted state like.. is called the client's Close method fires but throws an error because it's in a faulted state. The original exception is then..
Is it possible to dynamically compile and execute C# code fragments? http://stackoverflow.com/questions/826398/is-it-possible-to-dynamically-compile-and-execute-c-sharp-code-fragments i results.Errors.Cast CompilerError .ToList .ForEach error Console.WriteLine error.ErrorText The class of primary importance.. CompilerError .ToList .ForEach error Console.WriteLine error.ErrorText The class of primary importance here is the CSharpCodeProvider..
Nullable types and the ternary operator: why is `? 10 : null` forbidden? [duplicate] http://stackoverflow.com/questions/858080/nullable-types-and-the-ternary-operator-why-is-10-null-forbidden code compile 4 answers I just came across a weird error private bool GetBoolValue Do some logic and return true or false.. There's no implicit conversion between those two hence the error message. If you change the right hand expression to one of the..
Using C#, how does one figure out what process locked a file? http://stackoverflow.com/questions/860656/using-c-how-does-one-figure-out-what-process-locked-a-file nLength ...this call sometimes hangs. Is a Windows error. while uint Win32API.NtQueryObject ipHandle int Win32API.ObjectInformationClass.ObjectNameInformation..
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 before it's been saved back to the filesystem and throw an error File in use by another process . I would like to find a way..
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 the variable in a way that makes it highly prone to an error that is often difficult to find and debug while producing no.. the variable in a way that makes it highly prone to an error that is often difficult to find and debug while producing no..
ASP.NET MVC Custom Error Handling Application_Error Global.asax? http://stackoverflow.com/questions/1171035/asp-net-mvc-custom-error-handling-application-error-global-asax MVC Custom Error Handling Application_Error Global.asax I have some basic code.. MVC Custom Error Handling Application_Error Global.asax I have some basic code to determine errors in my.. Currently in the project I have a controller called Error with action methods HTTPError404 HTTPError500 and General ...
Difference between ref and out parameters in .NET [duplicate] http://stackoverflow.com/questions/135234/difference-between-ref-and-out-parameters-in-net to set it to something. int x Foo out x OK int y Foo ref y Error Ref parameters are for data that might be modified out parameters..
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 MessageBox.Show Company does not exist. Error MessageBoxButton.OK MessageBoxImage.Exclamation cs.txtCompanyID.Focusable..
Conditional operator cannot cast implicitly? http://stackoverflow.com/questions/2215745/conditional-operator-cannot-cast-implicitly aByteValue 0 But this will not aByteValue aBoolValue 1 0 Error says Cannot implicitly convert type 'int' to 'byte'. And of..
Using AES encryption in C# http://stackoverflow.com/questions/273452/using-aes-encryption-in-c-sharp Trip 0 roundtrip catch Exception e Console.WriteLine Error 0 e.Message static byte EncryptStringToBytes string plainText..
How do I create a custom membership provider for ASP.NET MVC 2? http://stackoverflow.com/questions/2771094/how-do-i-create-a-custom-membership-provider-for-asp-net-mvc-2 of the view to render on authorization failure. Default is Error . summary public virtual string ViewName get set public MyAuthorizationAttribute.. set public MyAuthorizationAttribute base this.ViewName Error protected void CacheValidateHandler HttpContext context object..
Kill child process when parent process is killed http://stackoverflow.com/questions/3342941/kill-child-process-when-parent-process-is-killed uint cbJobObjectInfoLength DllImport kernel32.dll SetLastError true static extern bool AssignProcessToJobObject IntPtr job.. new Exception string.Format Unable to set information. Error 0 Marshal.GetLastWin32Error #region IDisposable Members public.. Unable to set information. Error 0 Marshal.GetLastWin32Error #region IDisposable Members public void Dispose Dispose true..
Enum ToString http://stackoverflow.com/questions/479410/enum-tostring private enum PublishStatusses NotCompleted Completed Error I want to be able to output these values in a user friendly.. Description Not Completed NotCompleted Completed Error Then use this code to retrieve it public static string GetDescription..
How can I evaluate a C# expression dynamically? http://stackoverflow.com/questions/53844/how-can-i-evaluate-a-c-sharp-expression-dynamically cr c.CompileAssemblyFromSource cp sb.ToString if cr.Errors.Count 0 throw new InvalidExpressionException string.Format.. 0 throw new InvalidExpressionException string.Format Error 0 evaluating 1 cr.Errors 0 .ErrorText sExpression System.Reflection.Assembly.. string.Format Error 0 evaluating 1 cr.Errors 0 .ErrorText sExpression System.Reflection.Assembly a cr.CompiledAssembly..
“The Controls collection cannot be modified because the control contains code blocks” http://stackoverflow.com/questions/778952/the-controls-collection-cannot-be-modified-because-the-control-contains-code-bl to the user control I get this # @# error Server Error in ' ' Application. The Controls collection cannot be modified.. because the control contains code blocks i.e. ... . Source Error An unhandled exception was generated during the execution of..
Create Generic method constraining T to an Enum http://stackoverflow.com/questions/79126/create-generic-method-constraining-t-to-an-enum .ToLower return item return defaultValue I am getting a Error Constraint cannot be special class 'System.Enum'. Fair enough..
Nullable types and the ternary operator: why is `? 10 : null` forbidden? [duplicate] http://stackoverflow.com/questions/858080/nullable-types-and-the-ternary-operator-why-is-10-null-forbidden null to the nullable int. However the compiler complains Error 1 Type of conditional expression cannot be determined because..
Why are the properties of anonymous types in C# read-only? http://stackoverflow.com/questions/1089406/why-are-the-properties-of-anonymous-types-in-c-sharp-read-only new Surname Smith OtherNames John person.Surname Johnson ERROR .Surname is read only Of course I can declare a real class if..
In C#, why can't i test if a event handler is null anywhere outside of the class that it's defined? http://stackoverflow.com/questions/1246116/in-c-why-cant-i-test-if-a-event-handler-is-null-anywhere-outside-of-the-class bool IsSomeEventHandlerNull LEFT HAND SIDE COMPILER ERROR return SomeEvent null class Program static void Main string.. FuncToHandle LEFT HAND SIDE COMPILER ERROR if useSomeEvent.SomeEvent null var useSomeEventBase new UseSomeEventBase.. FuncToHandle LEFT HAND SIDE COMPILER ERROR if useSomeEventBase.SomeEvent null static void FuncToHandle..
How do I use a Service Account to Access the Google Analytics API V3 with .NET C#? http://stackoverflow.com/questions/12980215/how-do-i-use-a-service-account-to-access-the-google-analytics-api-v3-with-net-c o oauth2 token 2012 10 19 13 27 36 954 GMT 4 8 ERROR DotNetOpenAuth.Http WebException from https accounts.google.com..
How to find default web browser using C#? http://stackoverflow.com/questions/13621467/how-to-find-default-web-browser-using-c .exe 4 catch Exception ex name string.Format ERROR An exception of type 0 occurred in method 1 in the following..
Thread Control.Invoke http://stackoverflow.com/questions/1423446/thread-control-invoke run it in ShowAllFly function cbFly.Items.Clear HERE Gives ERROR LIKE Control.Invoke must be used to interact with controls created..
anyway see why I get this “Concurrency Violation” in these few lines of code??? Concurrency violation: the UpdateCommand affected 0 of the expected 1 records http://stackoverflow.com/questions/1599230/anyway-see-why-i-get-this-concurrency-violation-in-these-few-lines-of-code Type this.DA_Webfiles.Update this.dataSet WEBFILES Get ERROR here Concurrency violation the UpdateCommand affected 0 of the..
The server committed a protocol violation. Section=ResponseStatusLine ERROR http://stackoverflow.com/questions/2482715/the-server-committed-a-protocol-violation-section-responsestatusline-error committed a protocol violation. Section ResponseStatusLine ERROR I have created a program tried to post a string on a site and..
How can I return NULL from a generic method in C#? http://stackoverflow.com/questions/302096/how-can-i-return-null-from-a-generic-method-in-c in collecion if thing.Id id return thing return null ERROR Cannot convert null to type parameter 'T' because it could be..
Entity Framework Include() is not working http://stackoverflow.com/questions/4474951/entity-framework-include-is-not-working sq.Order select q foreach var question in questions ERROR Null Reference Exception Console.WriteLine Question Type question.QuestionType.Description..
C# compile error: “Invoke or BeginInvoke cannot be called on a control until the window handle has been created.” http://stackoverflow.com/questions/513131/c-sharp-compile-error-invoke-or-begininvoke-cannot-be-called-on-a-control-unti message public void logAdd string message COMPILER ERROR BELOW this.Invoke new logAdd add new object message Compile.. new object message Compile error occurs here COMPILER ERROR ABOVE private void exitProgramToolStripMenuItem_Click object..
C# Using Activator.CreateInstance http://stackoverflow.com/questions/5262693/c-sharp-using-activator-createinstance originalData default throw new Exception ERROR Method method does not exist. However as the number of potential..
Why does the WPF designer fail to load libraries that call into unmanaged DLLs? http://stackoverflow.com/questions/6036631/why-does-the-wpf-designer-fail-to-load-libraries-that-call-into-unmanaged-dlls lib1 clr namespace ClassLibrary1 assembly ClassLibrary1 ERROR The error is Assembly 'ClassLibrary1' was not found. Verify..
How can I clear rows in DataGridView with C#? http://stackoverflow.com/questions/6184402/how-can-i-clear-rows-in-datagridview-with-c code datagridview1.DataSource null I get this error ERROR Object reference not set to an instance of an object This object.. not set to an instance of an object This object reference ERROR problem already solved in here . But I managed to solve my own..
Sending and receiving UDP packets between two programs on the same computer http://stackoverflow.com/questions/687868/sending-and-receiving-udp-packets-between-two-programs-on-the-same-computer true catch Exception Console.WriteLine ERROR You must call Bind only after setting SocketOptionName.ReuseAddress...
.NET - Convert Generic Collection to DataTable http://stackoverflow.com/questions/701223/net-convert-generic-collection-to-datatable PropertyDescriptor prop in properties HERE IS WHERE THE ERROR IS THROWN FOR NULLABLE TYPES table.Columns.Add prop.Name prop.PropertyType..
byte + byte = int… why? http://stackoverflow.com/questions/941584/byte-byte-int-why Looking at this C# code... byte x 1 byte y 2 byte z x y ERROR Cannot implicitly convert type 'int' to 'byte' The result of..
|