Frage

This is what I get:

'PatientDatabase.Properties.Settings' does not contain a definition for 'SQL' and no extension method 'SQL' accepting a first argument of type 'PatientDatabase.Properties.Settings' could be found (are you missing a using directive or an assembly reference?)`

Here is my code:

private void Form1_Load(object sender, EventArgs e)
{
        try
        {
            objConnect = new DatabaseConnection();
            conString = Properties.Settings.Default.patientDetailsConnectionString;

            objConnect.connection_string = conString;

            objConnect.sql = Properties.Settings.Default.SQL;

            ds = objConnect.GetConnection;

            MaxRows = ds.Tables[0].Rows.Count;
            NavigateRecords();

        }
        catch (Exception err)
        {
            MessageBox.Show(err.Message);
        }
}
War es hilfreich?

Lösung

It means that you don't have SQL in your settings file. Make sure that it exists and the casing is correct. Open the settings file and add node with SQL there. You can read the details here of how you can do that.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top