ILT – How to bring your window (form) to the top C#

2013/04/11 How to bring a window (form) to the top? Or how to make your window active from the code? Simply: call the Activate() function (method) of your form instance. Menol ILT

ILT – Command to lock a windows computer

19/03/2013 How to program your custom keyboard key to lock your computer? How to programmatically lock your computer? How to lock your computer from the run dialog box? How to lock your computer form DOS? Answer: Just use following command rundll32.exe user32.dll, LockWorkStation You can use this on the command prompt, the run dialog orContinue reading “ILT – Command to lock a windows computer”

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    

ILT – Click-Once Deployment Error – Cannot Publish Because a Project Failed to Build

28-08-2012 Deploying using click-once setup is very easy. If you need a step by step guide to deploy a click-once, I’d recommend this article. Even though it is easy to create a click-once deployment package, the visual studio can face problems if you have third party ad-ons like DevExpress. If you get an error calledContinue reading “ILT – Click-Once Deployment Error – Cannot Publish Because a Project Failed to Build”

ILT – How to convert string to enum in C#

15-08-2012 How to convert a value to an enum? How to find the matching enum value? Convert object to enum? How to use Enum.Parse method? Solution: Use the Enum.Parse method as shown below to convert your value to the appropriate enumerator type. Enum declaration – for explanation Actual casting Menol ILT

Unable to cast COM object of type error {6D5140C1-7436-11CE-8034-00AA006009FA}

08-08-2012 I got this error today from SQL Server Management Studio. It occurred when I was trying to brows databases by expanding the “Databases” folder in the SQL Server Management Studio navigation tree. Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘Microsoft.VisualStudio.OLE.Interop.IServiceProvider’. This operation failed because the QueryInterface call on the COMContinue reading “Unable to cast COM object of type error {6D5140C1-7436-11CE-8034-00AA006009FA}”

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 order of parameters in the OleDbCommand.Parameters collection. This can cause an Data type mismatch inContinue reading “Is Order Of OleDbCommand.Parameters Important”

How To Change The Combobox Index To Match A Target String

24-07-2012 I need to select “Item1” from the combo box. In other words, I need to select the index that matches the string in the “temp” variable and select that index. Solution Note: The FindString looks for a substring. If you need to perform an exact comparison then use Combobox.FindStringExact() Both these functions has overloadsContinue reading “How To Change The Combobox Index To Match A Target String”

How to Get the Underlying DataRow of a DataGridViewRow

23-07-2012 How to get the underlying data row of the bound data table linked to a DataGridViewRow in a DataGridView? How to get the underlying DataRow of a DataGridView.Row? How to get the underlying DataRow matching to a Selected Row of a DataGridView? How to map the DataGridView row to the datasource? How to getContinue reading “How to Get the Underlying DataRow of a DataGridViewRow”