質問

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);
        }
}
役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top