with my code i can create a sqlite data base file.
public static void sqlite(string sqlite_file)
{
SQLiteConnection.CreateFile(sqlite_file);
string str = "CREATE TABLE IF NOT EXISTS `aliases` (`key` varchar(255) NOT NULL,`value` varchar(255) NOT NULL);.... "
SQLiteConnection connection = new SQLiteConnection {
ConnectionString = "Data Source=" + sqlite_file
};
connection.Open();
SQLiteCommand command = new SQLiteCommand(connection) {
CommandText = str
};
command.ExecuteNonQuery();
command.Dispose();
connection.Close();
connection.Dispose();
}
so my question : i want create a database with read data from external sql file like c://mysql/ramin.sql what change i must do in my code?!
and data format on ramin.sql file is :
CREATE TABLE IF NOT EXISTS `aliases` (`key` varchar(255) NOT NULL,`value` varchar(255) NOT NULL);
CREATE TABLE IF NOT EXISTS `badnames` (`badname` varchar(255) NOT NULL);
CREATE TABLE IF NOT EXISTS `badwords` (`badword` varchar(255) NOT NULL);
and evey command in every line...