Kurisu 🐧
Kurisu 🐧
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
The exception throw when we reach the using with the reader
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
private static readonly string connectionString = @"Data Source=C:\Users\Utilisateur\source\repos\DiscordBotIEN\IENDB.sqlite";
private static readonly string connectionString = @"Data Source=C:\Users\Utilisateur\source\repos\DiscordBotIEN\IENDB.sqlite";
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
CREATE TABLE Joueur (
IDDiscord INTEGER,
IDClash TEXT PRIMARY KEY, -- Clé primaire
Clan TEXT,
Role TEXT,
MembreDepuis DATE,
AQuitte DATE
);
CREATE TABLE Sanction (
IDSanction INTEGER PRIMARY KEY, -- Clé primaire
Type TEXT NOT NULL,
DateSanction DATE NOT NULL,
IDClash TEXT, -- Clé étrangère qui référence la table Joueur
FOREIGN KEY (IDClash) REFERENCES Joueur(IDClash) ON DELETE CASCADE
);
CREATE TABLE Joueur (
IDDiscord INTEGER,
IDClash TEXT PRIMARY KEY, -- Clé primaire
Clan TEXT,
Role TEXT,
MembreDepuis DATE,
AQuitte DATE
);
CREATE TABLE Sanction (
IDSanction INTEGER PRIMARY KEY, -- Clé primaire
Type TEXT NOT NULL,
DateSanction DATE NOT NULL,
IDClash TEXT, -- Clé étrangère qui référence la table Joueur
FOREIGN KEY (IDClash) REFERENCES Joueur(IDClash) ON DELETE CASCADE
);
List<(string IDClash, int IDDiscord)> joueursIDs = new List<(string, int)>();

using (SqliteConnection connection = new SqliteConnection(connectionString))
{
connection.Open();

// Requête pour récupérer uniquement les IDClash et IDDiscord
string query = "SELECT IDClash, IDDiscord FROM Joueur";

using (SqliteCommand command = new SqliteCommand(query, connection))
using (SqliteDataReader reader = command.ExecuteReader()) //the exception appear here

{
while (reader.Read())
{
// Récupérer IDClash et IDDiscord et les ajouter à la liste
string idClash = reader.GetString(0);
int idDiscord = reader.GetInt32(1);
joueursIDs.Add((idClash, idDiscord));
}
}
}

// Affichage des IDClash et IDDiscord
foreach (var joueurID in joueursIDs)
{
Console.WriteLine($"IDClash: {joueurID.IDClash}, IDDiscord: {joueurID.IDDiscord}");
}
List<(string IDClash, int IDDiscord)> joueursIDs = new List<(string, int)>();

using (SqliteConnection connection = new SqliteConnection(connectionString))
{
connection.Open();

// Requête pour récupérer uniquement les IDClash et IDDiscord
string query = "SELECT IDClash, IDDiscord FROM Joueur";

using (SqliteCommand command = new SqliteCommand(query, connection))
using (SqliteDataReader reader = command.ExecuteReader()) //the exception appear here

{
while (reader.Read())
{
// Récupérer IDClash et IDDiscord et les ajouter à la liste
string idClash = reader.GetString(0);
int idDiscord = reader.GetInt32(1);
joueursIDs.Add((idClash, idDiscord));
}
}
}

// Affichage des IDClash et IDDiscord
foreach (var joueurID in joueursIDs)
{
Console.WriteLine($"IDClash: {joueurID.IDClash}, IDDiscord: {joueurID.IDDiscord}");
}
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
Same error with a relative path
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
just that DB
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
When I execute my query in Sqlite itself, it works
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
That's a sqlite file located in my project
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
No description
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
@"Data Source=C:\Users\Utilisateur\source\repos\DiscordBotIEN\IENDB.sqlite, Version=3"
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
I verified that
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
Nah
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
To see the currents tables
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
.schema is an internal command in SQlite
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
Player in french
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
The connection string point to the good file
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
What's the issue?
35 replies
CC#
Created by Kurisu 🐧 on 10/28/2024 in #help
Issue with SQlite command
When I try to execute that Query I've this error. The table "Joueur" doesn't exist but when I do a .schema in my DB file, the table exist
35 replies