Syntax error in FROM clause. this error yellow `var reader = commandSourceData.ExecuteReader(); const string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\myphonebook.mdb"; const string connectionStringDest = @"server=ahmad-pc\anfd;database = phonebook;Integrated Security = true"; using (var sourceConnection =new OleDbConnection(connectionString)) { sourceConnection.Open(); var commandSourceData = new OleDbCommand("SELECT name,family FROM number;", sourceConnection); var reader = commandSourceData.ExecuteReader(); using (var destinationConnection = new SqlConnection(connectionStringDest)) { destinationConnection.Open(); using (var bulkCopy = new SqlBulkCopy(destinationConnection)) { bulkCopy.DestinationTableName ="dbo.profile"; try { bulkCopy.WriteToServer(reader); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { reader.Close(); } } } }
using (var sourceConnection =new OleDbConnection(connectionStringDest))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)