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