Я только что понял это;
for (int i = 2; i <= xlWorksheet.UsedRange.Rows.Count; i++)
{
if (Playlist_Path_col != 0) { Playlist_Path = xlRange.Cells[i, Playlist_Path_col].Text; }
if (Playlist_Audio_Path_col != 0) { Playlist_Audio_Path = xlRange.Cells[i, Playlist_Audio_Path_col].Text; }
if (Playlist_Duration_col != 0) { Playlist_Duration = xlRange.Cells[i, Playlist_Duration_col].Text; }
if (Playlist_Auto_Start_col != 0) { Playlist_Auto_Start = xlRange.Cells[i, Playlist_Auto_Start_col].Text; }
if (Playlist_Date_col != 0) { Playlist_Date = xlRange.Cells[i, Playlist_Date_col].Text; }
if (Video_Path_col != 0) { Video_Path = xlRange.Cells[i, Video_Path_col].Text; }
if (Video_Audio_Path_col != 0) { Video_Audio_Path = xlRange.Cells[i, Video_Audio_Path_col].Text; }
if (Video_NameExt_col != 0) { Video_NameExt = xlRange.Cells[i, Video_NameExt_col].Text; }
if (Video_Name_col != 0) { Video_Name = xlRange.Cells[i, Video_Name_col].Text; }
if (Video_Note_col != 0) { Video_Note = xlRange.Cells[i, Video_Note_col].Text; }
if (Video_Category_col != 0) { Video_Category = xlRange.Cells[i, Video_Category_col].Text; }
if (Video_URL_col != 0) { Video_URL = xlRange.Cells[i, Video_URL_col].Text; }
if (Video_In_Time_col != 0) { Video_In_Time = xlRange.Cells[i, Video_In_Time_col].Text; }
if (Video_INOUT_Duration_col != 0) { Video_INOUT_Duration = xlRange.Cells[i, Video_INOUT_Duration_col].Text; }
if (Video_Width_col != 0) { Video_Width = xlRange.Cells[i, Video_Width_col].Text; }
if (Video_Height_col != 0) { Video_Height = xlRange.Cells[i, Video_Height_col].Text; }
if (Video_Rate_col != 0) { Video_Rate = xlRange.Cells[i, Video_Rate_col].Text; }
if (Video_Colorspace_col != 0) { Video_Colorspace = xlRange.Cells[i, Video_Colorspace_col].Text; }
if (Video_Aspect_Ratio_col != 0) { Video_Aspect_Ratio = xlRange.Cells[i, Video_Aspect_Ratio_col].Text; }
if (Video_Interlace_col != 0) { Video_Interlace = xlRange.Cells[i, Video_Interlace_col].Text; }
if (Audio_Channel_col != 0) { Audio_Channel = xlRange.Cells[i, Audio_Channel_col].Text; }
if (Audio_Channel_Bit_col != 0) { Audio_Channel_Bit = xlRange.Cells[i, Audio_Channel_Bit_col].Text; }
if (Audio_Bit_Rate_col != 0) { Audio_Bit_Rate = xlRange.Cells[i, Audio_Bit_Rate_col].Text; }
if (LiveSource_Path_col != 0) { LiveSource_Path = xlRange.Cells[i, LiveSource_Path_col].Text; }
if (LiveSource_Audio_Path_col != 0) { LiveSource_Audio_Path = xlRange.Cells[i, LiveSource_Audio_Path_col].Text; }
if (LiveSource_Name_col != 0) { LiveSource_Name = xlRange.Cells[i, LiveSource_Name_col].Text; }
if (LiveSource_Note_col != 0) { LiveSource_Note = xlRange.Cells[i, LiveSource_Note_col].Text; }
if (LiveSource_Category_col != 0) { LiveSource_Category = xlRange.Cells[i, LiveSource_Category_col].Text; }
if (LiveSource_URL_col != 0) { LiveSource_URL = xlRange.Cells[i, LiveSource_URL_col].Text; }
if (LiveSource_IN_Time_col != 0) { LiveSource_IN_Time = xlRange.Cells[i, LiveSource_IN_Time_col].Text; }
if (LiveSource_OUT_Time_col != 0) { LiveSource_OUT_Time = xlRange.Cells[i, LiveSource_OUT_Time_col].Text; }
if (LiveSource_INOUT_Duration_col != 0) { LiveSource_INOUT_Duration = xlRange.Cells[i, LiveSource_INOUT_Duration_col].Text; }
if (LiveSource_Width_col != 0) { LiveSource_Width = xlRange.Cells[i, LiveSource_Width_col].Text; }
if (LiveSource_Height_col != 0) { LiveSource_Height = xlRange.Cells[i, LiveSource_Height_col].Text; }
if (LiveSource_Rate_col != 0) { LiveSource_Rate = xlRange.Cells[i, LiveSource_Rate_col].Text; }
if (LiveSource_Colorspace_col != 0) { LiveSource_Colorspace = xlRange.Cells[i, LiveSource_Colorspace_col].Text; }
if (LiveSource_Aspect_Ratio_col != 0) { LiveSource_Aspect_Ratio = xlRange.Cells[i, LiveSource_Aspect_Ratio_col].Text; }
if (LiveSource_Interlace_col != 0) { LiveSource_Interlace = xlRange.Cells[i, LiveSource_Interlace_col].Text; }
if (LiveSource_Channel_col != 0) { LiveSource_Channel = xlRange.Cells[i, LiveSource_Channel_col].Text; }
if (LiveSource_Channel_Bit_col != 0) { LiveSource_Channel_Bit = xlRange.Cells[i, LiveSource_Channel_Bit_col].Text; }
if (LiveSource_Bit_Rate_col != 0) { LiveSource_Bit_Rate = xlRange.Cells[i, LiveSource_Bit_Rate_col].Text; }
Я использовал xlRange.Cells [i, LiveSource_Bit_Rate_col] .Value2;так что эта команда давала мне значение ячейки, но она также давала мне значение с ее форматом ... поэтому я снова искал и нашел .Text вместо .Value2, и он работал очень хорошо ... и при заполнении моего представления данных яиспользовал это
string[] format = new string[] { "dd/MM/yyyy HH:mm:ss" };
DateTime datetime;
if (DateTime.TryParseExact(data.Rows[i][z].ToString(), format, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.NoCurrentDateDefault, out datetime))
dataGridView1.Rows[i + 2].Cells[z].Value = datetime.ToString("hh:MM:ss");
else
dataGridView1.Rows[i + 2].Cells[z].Value = data.Rows[i][z];
Это немного сложно, но работает очень хорошо в настоящее время ..