Tag Archives: C#

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

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 a match that holds or returns (for methods) … Continue reading

Posted in C#.Net | Tagged , , , , , , , , , , , , , | Leave a comment

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

2016-06-16

Posted in C#.Net | Tagged , , , , , | Leave a comment

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

03-10-2012 How to get major, minor, build and revision version figures for a visual studio solution (using c#)? Menol ILT    

Posted in C#.Net | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

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 parameters in your SQL statement according to the … Continue reading

Posted in C#.Net, Microsoft Access | Tagged , , , , , , , , , , | Leave a comment

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. Menol ILT

Posted in C#.Net | Tagged , , , | Leave a comment

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 as expected or if it encountered any errors. The commonly … Continue reading

Posted in C#.Net | Tagged , , , , | Leave a comment

How to Implement a Background Worker Thread that Supports Cancellation (How to Stop A Background Thread)

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 have to implement before. 1. First of all, … Continue reading

Posted in C#.Net | Tagged , , , , | Leave a comment

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 cannot be casted. Since the “as” keyword sets … Continue reading

Posted in C#.Net | Tagged , , , , , | Leave a comment

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

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 flexible search module for a project I’m … Continue reading

Posted in C#.Net | Tagged , , , , , , , , , , , , , , | Leave a comment

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 which holds … Continue reading

Posted in ASP.Net, C#.Net | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment