为字符串变量优化的关系数据库

时间:2017-03-20 05:24:23

标签: c# database string sqlite

是否有任何数据库仅用于存储string变量?

我目前在C#中使用Sqlite库,但它对我来说工作缓慢。 由于Sqlite允许您存储多种数据类型。我正在寻找针对存储string变量进行优化的内容。

如果您的答案仍然是Sqlite,那么我的编码必须是使交易变慢的问题。

基本上我在循环中调用,我只是将字符串添加到循环中执行的'INSERT'命令中。

这是代码的样子:

sql_connection = new SQLiteConnection("Data Source=File.db;Version=3;New=False;Compress=True;");
sql_connection.Open();
sql_cmd = sql_connection.CreateCommand();
 for (int x = 0; x < Count; x++)
{
    sql_cmd.CommandText = "INSERT INTO main_list (File_Name, File_Location) VALUES (\'" + grid_file_list.Rows[x].Cells[0].Value.ToString() + "\', \'" + grid_file_list.Rows[x].Cells[1].Value.ToString() + "');";
    sql_cmd.ExecuteNonQuery();
}

0 个答案:

没有答案
相关问题