문제

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