21 lines
703 B
C#
21 lines
703 B
C#
using Microsoft.Data.Sqlite;
|
|
using Project.Model;
|
|
namespace Project.Persistence;
|
|
|
|
public partial class SQLite
|
|
{
|
|
//get login name and password to compare it with inputs
|
|
public static void GetLogin(string username, string password)
|
|
{
|
|
using var connection = new SqliteConnection($"Data Source={_dbPath}");
|
|
connection.Open();
|
|
using (var command = connection.CreateCommand())
|
|
{
|
|
command.Parameters.AddWithValue("@loginname", username);
|
|
command.Parameters.AddWithValue("@loginpass", password);
|
|
command.CommandText =
|
|
@"SELECT * FROM TABLE ( LOGINS ) WHERE loginname = @loginname
|
|
";
|
|
}
|
|
}
|
|
} |