Quantcast
Channel: C# – I learnt today
Browsing all 12 articles
Browse latest View live

C# ASP.NET – GridView : How to Keep Modified Data of Template Fields when...

2008-12-04 Today I had to take care of a problem of a certain company (CIS) that I consult. They had a problem of keeping the values modified in a template field of a gridview when the user moves from...

View Article



Image may be NSFW.
Clik here to view.

C# ASP.NET – GridView : How to Use Checkbox in Gridview to Select Multiple Rows

2009-01-06 // ]]> I wanted to select multiple rows of the grid view using check boxes to select each row. In this post I will discus how and what I did to achieve this goal… I used a template column...

View Article

How to use LIKE operator in Dataview.RowFilter for Date Time or Numaric...

2012-01-16 // ]]> The RowFilter property of the DataView allows to use flexible string similar to SQL or LINQ to easily filter rows wihtout having to iterate through them. I had to implement a fully...

View Article

Use of “as” keyword as for casting in C#

2009-01-06 The keyword as doesn’t throw an exception if it fails to complete the casting operation. Instead it will return null. Other casting operations will throw an exception when the provided value...

View Article

How to Implement a Background Worker Thread that Supports Cancellation (How...

30-05-2012 The background worker in .net provides a method CancelAsync() to cancel a background worker. However, calling this method will not stop a worker thread there has to be several things you...

View Article


How To Exit or End a C Sharp (C#) Application

12-06-2012 To exit a c# program simply use following command: Environment.Exit(int Status); Status is the integer you return to tell the environment how your program concludes. If it executed according...

View Article

Use of Nullable ?? Operator in C#

20-07-2012 Use ?? operator to tell the compiler how to assign a null-able variable to a non-null-able variable. // ?? operator example. int? x = null; // y = x, unless x is null, in which case y = -1....

View Article

Is Order Of OleDbCommand.Parameters Important

01-08-2012 The order of the parameters collection of an OleDbCommand must match the order to which those parameters appear in the SQL statement. Otherwise the .net framework will try to fill the...

View Article


ILT – How to Programmatically Get Version Information of a Visual Studio...

03-10-2012 How to get major, minor, build and revision version figures for a visual studio solution (using c#)? // Step 1: Create a <a...

View Article


C# extension method to check if a string matches any string in given list

2016-06-16 /// <summary> /// Note: this uses ordinal comparison /// </summary> /// <param name="?"></param> /// <param name="Options"></param> /// <param...

View Article

C# Reflection Code to Search Objects for Fields Properties and Methods and...

2016-07-06 Code below will search for a given named property, field, or method inside a given object. It will search in below order: Properties Fields Methods It will continue to search until it finds...

View Article

Solved: The destination thread no longer exists exception – C#

2016-11-08 You will get System.ComponentModel.InvalidAsynchronousStateException (The destination thread no longer exists.) if a UI component gets disposed or the UI thread EXITs while a different...

View Article
Browsing all 12 articles
Browse latest View live




Latest Images