C#: How to set query result to combo box in datagridview
<p>I have a datagrid in which i have combobox in a column. On a particular event i want to populate the combo box with result of the query. I wrote this code</p>

<pre><code>string materialQuery = "Select material_name from tbl_material_master where material_id =" + int.Parse(mat_id);
            cmd1 = new SqlCommand(materialQuery, con);
            sdr = cmd1.ExecuteReader();
            if (sdr.HasRows)
            {
                while (sdr.Read())
                {
                    materialName = sdr["material_name"].ToString();
                    grdPurchase.Rows[0].Cells[2] = materialName.ToString();
                }
            }
</code></pre>

<p>But it gives error<br>
How do i fix this?</p>
