So basically here is the problem, I have tried many ways to fix it but none of them worked ! Error is getting at this line :Templist.Add((string)result["titre"];
.
Templist
is the error !
private List<string> ReadNews()
{
string SqlText = "SELECT * FROM nom_table";
List<string> Templist;
MySqlConnection SqlConnection = new
MySqlConnection(TheConnectionString);
MySqlCommand SqlCommand = new
MySqlCommand(SqlText,SqlConnection);
MySqlDataReader result = SqlCommand.ExecuteReader();
while (result.Read())
{
Templist.Add((string)result["titre"]);
}
return Templist;
}