Когда я экспортирую данные в excel, нулевые значения отсутствуют в листе excel в item_shade,
SqlCeCommand comm = new SqlCeCommand("Select Sno,Whs_No, Raymond_Barcode,Batch_No,Item_code,Item_shade,Item_flag,Item_Qty,Date_Entered from whsdata", cn); SqlCeDataReader reader = comm.ExecuteReader(); FileStream fs = File.Create(".//StockData.csv"); StreamWriter output = new StreamWriter(fs); String[] ListLines = new string[100]; output.Write("Sno, WareHouse_No, Raymond_Barcode,Batch_Number,ItemCode,Shades,Flag,Quantity, Date_Entered" + "\r\n"); while (reader.Read()) { ListLines[i] = reader["Sno"].ToString() + "" + reader["Whs_No"].ToString() + "," + reader["Raymond_Barcode"].ToString() + "," + reader["Batch_No"].ToString() + "," + reader["Item_code"].ToString() + "," + reader["Item_shade"].ToString() + "," + reader["Item_flag"].ToString() + "," + reader["Item_Qty"].ToString() + "," + reader["Date_Entered"].ToString(); //ListLines[i] = reader["Sno"].ToString() + "," + reader.GetString(1) + "," + reader.GetString(2) + "," + reader.GetString(3) + "," + reader.GetString(4) + "," + reader.GetString(5) + "," + reader.GetString(6) + "," + reader.GetString(7) + "," + reader.GetString(8); output.Write(ListLines[i] + "\r\n"); i++; } output.Flush(); fs.Close(); MessageBox.Show("Data Export Successfully");
Что я уже пробовал:
Нулевые значения Item_shade не отображаются.когда я перехожу в текстовый формат..