Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,

I have a data grid view . And I am filling it with from database.

//code

try
           {
               string query = "Select item_id,subject,team_member,status,department,types_of_graphics,graphics_type,priority,item_mode,in_time,out_time,description from Incident Order By item_id DESC";
               if (con.State == ConnectionState.Closed)
               {
                   con.Open();
               }

               MySqlCommand cmd = new MySqlCommand();
               //      cmd.CommandType = CommandType.StoredProcedure;
               cmd.CommandText = query;
               cmd.Connection = con;

               MySqlDataAdapter da = new MySqlDataAdapter(cmd);
               DataTable dt = new DataTable();
               da.Fill(dt);
               if (dt.Rows.Count > 0)
               {
                   dgHelpDesk.Refresh();
                   dgHelpDesk.DataSource = dt;

                   //show_description();
               }
               else
               {
                   dgHelpDesk.Refresh();
               }
           }
           catch (Exception ex)
           {
               MessageBox.Show(ex.Message);
           }
           finally
           {

               con.Close();
           }


But There are two column in datagridview in which My need is change value Format. So how can I change Here. //

Encoding.UTF8.GetString(Convert.FromBase64String(dgHelpDesk.Rows[a].Cells["subject"].Value.ToString()))



// Can I change a particular cell Encoding??
Posted
Updated 23-Apr-13 3:45am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900