how to use Upper function in mysql using c#
hello every one,
i have big problem in mysql . i want to use Uper function when i m selected name of country... this is my store Procedure where i have used the upper function.. plz check it and let me know where is the mistak....
//this is code of MySql
DELIMITER $$
DROP PROCEDURE IF EXISTS `library`.`ps_country_show` $$
CREATE DEFINER=`root`@`%` PROCEDURE `ps_country_show`()
BEGIN
select country_id, UPPER(country_name) from tbl_country;
END $$
// this is code of C#
private void show_country()
{
try
{
DataSet ds = new DataSet();
ds = gBL.show_country();
cb_country.DataSource = ds.Tables[0];
cb_country.DisplayMember = "country_name";
cb_country.ValueMember = "country_id";
}
catch (Exception ex)
{
}
i dont know where is the mistake please help me its too urgent
thanks in advance

Kirtan PatelPosted Nov 24, 2009, 6:38 AM
Try
UCASE() instead of UPPER() Function.
SELECT UCASE(country_name) as CountryName FROM TableNameHere
if still not getting desire result then post your gBL.showCountry() function's code will try to resolve it :)
thanks :)
Kirtan PatelPosted Nov 24, 2009, 10:20 AM
Here is Result From My Laptop About Using UPPER() function and Its Works Fine
private void button1_Click(object sender, EventArgs e)
{
MySqlConnection con = new MySqlConnection("server=127.0.0.1;User Id=root;password=12345;database=test");
con.Open();
MySqlCommand comm = new MySqlCommand("select UPPER(name),age from testtable", con);
DataSet ds = new DataSet();
MySqlDataAdapter da = new MySqlDataAdapter(comm);
da.Fill(ds, "vtable");
con.Clone();
dataGridView1.DataSource = ds.Tables[0];
}
Kirtan PatelPosted Nov 24, 2009, 9:26 AM
I can Provide you Sample of doing this task
because if i ask you to send a project files then i will not get MySqlDatabase so finally i provide you sample that is doing same king of task using mysql
wait for some time just coding it for you :)
Naeem KhanPosted Nov 24, 2009, 7:42 AM
Kirtan PatelPosted Nov 24, 2009, 7:30 AM
{
DataSet ds = new DataSet();
string msg = "";
MySqlParameter[] myParams = new MySqlParameter[0];
try
{
gDB.OpenConnection();
ds = gDB.ExecuteDataSet("ps_country_show", myParams);
gDB.CloseConnection();
}
catch (Exception ex)
{
msg = ex.Message;
}
return ds;
}
Naeem KhanPosted Nov 24, 2009, 6:45 AM