I have the folowing class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Odbc;
namespace Framework
Well, the error tells all the information required:
accessibility modifier ... accessor must be more restrictive than the property ...
private OdbcConnection db { // <- property as whole is "private"
get;
private set; // <- accessor (set) is explictly declared as "private"
}
So you can do either
// property as a whole is "public", but "set" accessor is "private"
// and so the accessor is more restrictive than the property
public OdbcConnection db { // <- property as whole is "public"
get;
private set; // <- accessor is "private" (more restrictive than "public")
}
Or
private OdbcConnection db {
get;
set; // <- just don't declare accessor modifier
}