0

Hello ,
I have problem with text encoding.

How can I change text encoding in connection parameters or string encoding ?

My code:

ArrayList dataFromDB = new ArrayList();

        string query = "select filialnr, filialbezeichnung from filiale order by 1";
        string baza = "Data Source=PLHQ001L;User Id=xxx;Password=xxx;";

        OracleConnection conn = new OracleConnection(baza);

        conn.Open();
        OracleCommand cmd = new OracleCommand(query, conn);
        cmd.CommandType = CommandType.Text;

        OracleDataReader dr = cmd.ExecuteReader();

         while (dr.Read())
        {
            for (int i = 0; i < dr.FieldCount; i = i + 1)
            {
                dataFromDB.Add(dr[i]);

            }
        }
        conn.Close();



        //Clear dataGridView
        for (int RowId = 0; RowId <= dataGridView1.RowCount; RowId++)
        {
            dataGridView1.Rows.Clear();
        }


        int rowNum = 0;
        for (int i = 0; i < dataFromDB.Count; i = i + 8)
        {
            dataGridView1.Rows.Add();
            dataGridView1[0, rowNum].Value = dataFromDB[i];
            dataGridView1[1, rowNum].Value = dataFromDB[i + 1];
            rowNum++;
        }

Edited by pyTony: fixed formating

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by lukasrzeznik
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.