Есть функция которая возвращает список из полученных данных из БД, какой у нее должен быть тип?
public ??????????????? CreditsList(Credit.MainWindow MainWindow)
{
Connection();
string query = "SELECT * FROM credits";
SqlCommand command = new SqlCommand(query, connection);
SqlDataReader reader = command.ExecuteReader();
List<CreditsList> result = new List<CreditsList>();
while (reader.Read())
{
int credit_id = Convert.ToInt32(reader["credit_id"]);
string credit_name = Convert.ToString(reader["credit_name"]);
double credit_percent = Convert.ToDouble(reader["credit_percent"]);
string credit_info = Convert.ToString(reader["credit_info"]);
result.Add(new CreditsList(credit_id, credit_name, credit_percent, credit_info));
}
reader.Close();
connection.Close();
return result;
}