Код для SQL на C#.
Код:
Message msg = e.Message;
name = msg.Chat.FirstName;
DB = new SQLiteConnection(@"Data Source = C:SBGLSCORE.db ;Version=3");
DB.Open();
SQLiteCommand cmd1 = DB.CreateCommand();
cmd1.CommandText = "select * from Score";
SQLiteDataReader SQLL = cmd1.ExecuteReader();
if (SQLL.HasRows)
{
if (SQLL["score"].ToString() == name.ToUpper())
{
}
}
else
{
SQLL.Close();
cmd1.CommandText = "insert into Score (score,name) values (@score,@name)";
cmd1.Parameters.Add("@score", System.Data.DbType.Int32).Value = score;
cmd1.Parameters.Add("@name", System.Data.DbType.String).Value = name.ToUpper();
cmd1.ExecuteNonQuery();
}
name = msg.Chat.FirstName;
DB = new SQLiteConnection(@"Data Source = C:SBGLSCORE.db ;Version=3");
DB.Open();
SQLiteCommand cmd1 = DB.CreateCommand();
cmd1.CommandText = "select * from Score";
SQLiteDataReader SQLL = cmd1.ExecuteReader();
if (SQLL.HasRows)
{
if (SQLL["score"].ToString() == name.ToUpper())
{
}
}
else
{
SQLL.Close();
cmd1.CommandText = "insert into Score (score,name) values (@score,@name)";
cmd1.Parameters.Add("@score", System.Data.DbType.Int32).Value = score;
cmd1.Parameters.Add("@name", System.Data.DbType.String).Value = name.ToUpper();
cmd1.ExecuteNonQuery();
}