I would like to declare a class Level DataSet in a Form code.
public partial class Frm_Stazione : Form
{
public Frm_Stazione()
{
InitializeComponent();
}
private readonly DataSet DS = new DataSet();
private void Frm_Stazione_Load(object sender, EventArgs e)
{
………
}
}
It is declared that way because the dataset must be accessible by different voids and must remain available until the Form is closed. My question is this: Visual Studio version 2019, indicates this error:
'IDE0069 The DS disposable field is never deleted'.
Certainly I'm wrong something, which can be my mistake. The code is written in C#.