郁闷问题,谁能告诉我为什么!!我快疯了
SqlConnection cn = new SqlConnection( "Data Source = localhost;User ID = sa;Password = pp;DATABASE = db ");
cn.Open();
SqlCommand cmd = new SqlCommand( "Select wo_id,wo_state from Working ",cn);
DataTable tbl = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(tbl);
for (int i = 0; i < tbl.Rows.Count; i++)
{
ListViewItem lvi = new ListViewItem();
switch (tbl.Rows[i][ "wo_state "].ToString())
{
case "完成 ":
lvi.ForeColor = Color.Red;
break;
case "开始 ":
lvi.ForeColor = Color.Green;
break;
case "待工 ":
lvi.ForeColor = Color.Blue;
break;
defaul