Showing posts with label lower. Show all posts
Showing posts with label lower. Show all posts

Sunday, 27 September 2009

Display information in Upper and Lower case from SQL database

In my database table (products) I have a column called items that lists a number of products in sentence case. In order to display them in upper and lower case I do the following :

Open query analyser.
Select the required database.

Upper case

Select upper (item) from products

Lower case

Select lower (item) from products

Collect user input from form and change it to upper or lower case in C#

In this example I have a text box on my windows form to collect the user input and a label to display the outcome once a button is pressed. The code is as follows to change the input to upper and lower case.

private void button3_Click(object sender, EventArgs e)

{

label1.Text = textBox.Text.ToUpper();

}

or

{

label1.Text = textBox.Text.ToLower();

}