Welcome to my blog which contains anything and everything I feel is worthwhile sharing......

Wednesday, June 20, 2012

Single Quotes in Oracle/ PL SQL

SELECT 'single quotes' from dual;

output :
single quotes

SELECT '''single quotes''' from dual;

output:
'single quotes'

When using a variable :
 The following script

DECLARE
VAR_ VARCHAR2(20):='Single Quotes';
BEGIN
   dbms_output.put_line(''''||VAR_||'''');
END;

will produce this output :
'Single Quotes'


Tuesday, March 27, 2012

Creating an auto-complete box C#

Create a Standard C# Form and add a combo box.

The following method initializes the combo box with the auto-complete functionality.

public void init_box()
{
AutoCompleteStringCollection ax = new AutoCompleteStringCollection();
if (File.Exists("List.txt"))
{
using (StreamReader reader = new StreamReader("List.txt"))
{
string line;
while ((line = reader.ReadLine()) != null)
{
ax.Add(line);
}
}
}
comboBox1.AutoCompleteCustomSource = ax;
comboBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;

}

next, this method is called on the mouse click event of the combo box.

private void comboBox1_MouseClick(object sender, MouseEventArgs e)
{
init_box();
}