string strConnection = ConfigurationManager.ConnectionStrings["Harfosh.Properties.Settings.TYT"].ConnectionString;
//string strConnection = "ConfigurationManager.ConnectionStrings[Store_Manager.Properties.Settings.storemanagerConnectionString].Name;";
SqlConnection con = new SqlConnection(strConnection);
con.Open();
SqlCommand sqlCmd = new SqlCommand();
sqlCmd.Connection = con;
sqlCmd.CommandType = CommandType.Text;
sqlCmd.CommandText = "Select rakmsanf ,esmsanf,esmmwrd,m5zn,quantity,w7da,reorder from Items Where m5zn =N'" + comboBox2.Text + "' ";
SqlDataAdapter sqlDataAdap = new SqlDataAdapter(sqlCmd);
System.Data.DataTable dtRecord = new System.Data.DataTable();
sqlDataAdap.Fill(dtRecord);
// DataGridView dataGridView1 = new DataGridView();
dataGridView1.DataSource = dtRecord;
if (dataGridView1.Columns[0] != null)
dataGridView1.Columns[0].HeaderText = "Key";
if (dataGridView1.Columns[1] != null)
dataGridView1.Columns[1].HeaderText = "Expire";
con.Close();
現在,我得到rakmsanf,esmsanf,esmmwrd,m5zn,quantity,w7da,reorder AND key Expire
我想改變的列標頭Key - Expire
,無需看rakmsanf ,esmsanf,esmmwrd,m5zn,quantity,w7da,reorder
(其他城市選擇的標題名稱)如何更改DatagridView列標題?
@Damith我試過這個,但我想阿拉伯名字,我得到錯誤 – user3119262
非常感謝它的工作吧! – user3119262
但我不能把空間例如: - رقمالصنف 得到錯誤但如果我typرقم只有它的作品! – user3119262