Я получаю сообщение об ошибке «Количество значений запроса и поля назначения не совпадают».для той части кода, которая указана ниже -
public static void SaveCurrentPlaylistToSheet(YouTubeVideo[] CurrentPlaylist)
{
string currentTitle;
using (connection = new OleDbConnection(ConnectionString))
{
connection.Open();
command = new OleDbCommand();
command.Connection = connection;
using (command = connection.CreateCommand())
{
for (int i = 0; i < CurrentPlaylist.Length; i++)
{
currentTitle = Regex.Replace(CurrentPlaylist[i].title, " ", "");
if (NewPlaylist)
{
command.CommandText = string.Format("INSERT INTO [" + ActiveSheetTitle + "] (F1) values({0})", currentTitle);
NewPlaylist = false;
}
else
{
command.CommandText = string.Format("INSERT INTO [" + ActiveSheetTitle + "$] (F1) values({0})", currentTitle);
}
command.ExecuteNonQuery(); // Execute insert query against excel file.
}
}
, мы будем благодарны за любую помощь в решении проблемы.Спасибо, Амитай