Ms Sql connection error

when create report with sql data source and pass it to web report,it give me this error "Can't find object MsSqlDataConnection".

Comments

  • edited 5:39AM
    code please.... .net core and .net framework use same syntax
    string connection = @"....";
    using (SqlConnection cnn = new SqlConnection(connection))
    {
        cnn.Open();
        using (SqlCommand cmd = new SqlCommand("SELECT * FROM Data", cnn))
        {
            using (SqlDataReader dr = cmd.ExecuteReader())
            {
                while (dr.Read())
                {
                   ...
                }
            }
        }
    }
    
  • edited 5:39AM
    I work with entity framework, and this error also happen if connect to sql directly from report designer and pass report file to web report while preview in designer work fine.
  • edited 5:39AM
    code:

    var Model = new WebReport();
    Model.Report.Load("Reports/SQLReport.frx");
    return View(Model);

    report file in attachment
  • edited 5:39AM
    are you using mssql connection embedded in frx file? delete it!
  • edited 5:39AM
    are you using mssql connection embedded in frx file? delete it!

    remember, report designer uses .net framework, and your web app uses .net standard (core) library
  • edited 5:39AM
    do you mean Delete all Dictionary childs nodes from frx file or just delete MsSqlDataConnection node and let it's childs?
  • edited March 2018
    just mssql data connection.

Leave a Comment