I'm using postgresql as a database and I have a column called mealsIds it's type is array of integers.
I'm making the following SQL query.
// Specify connection
NpgsqlConnection conn = new NpgsqlConnection(
"Server=127.0.0.1;" +
"User Id=username;" +
"Password=password;" +
"Database=db;" +
"Port=3500");
conn.Open();
// Define a query
NpgsqlCommand cmd = new NpgsqlCommand($"SELECT catsids FROM restaurants WHERE id = {Properties.Settings.Default.ResId.ToString()}", conn);
// Execute a query
NpgsqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
/*
I WANT TO INSERT CODE HERE
*/
}
// Close connection
conn.Close();
now I know that the result is an array of integers, and I want to store it in an array so I can use the values in it.
any idea how to do that??