locked
Class LIbrary RRS feed

  • Question

  • User1979860870 posted

    Hi

      I have added one Project Class Library to existing project

    On below code ' The name ConfigurationManger does not exist in current context.

    public static DataSet DataRecords(string SrcSql, SrcType SourceType = SrcType.SqlQuery)
            {
                DataSet ds = new DataSet();
                SqlDataAdapter da = new SqlDataAdapter(SrcSql, ConfigurationManager.ConnectionStrings["Cnn"].ConnectionString);
                da.Fill(ds);
                return ds;
            }

    Thanks

    Wednesday, May 19, 2021 4:15 PM

Answers

  • User475983607 posted

    If you are using VS 2019, when you mouse over the error, a helper icon should popup with suggestions to fix this very common programming task.

    Otherwise Add a reference to System.Configuration and add the following using statement to the top of the file with the error.

    using System.Configuration;  
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 19, 2021 6:45 PM