I was using mv project in .Netframe work 2.0 and then now I have changed into .netframework 3.1 , Now I am getting the error as ''Unable to cast object of type 'Microsoft.Data.SqlClient.SqlConnection' to type 'System.Data.SqlClient.SqlConnection' in the various places having the code as given below. How can I change the code to work with .netframework 3.1 , Please help
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
//using Microsoft.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
var conn = (SqlConnection)_db.Database.GetDbConnection();
DataTable dtMissingDates = new DataTable();
SqlParameter parUserId = new SqlParameter("@UserId", userId);
SqlParameter parDepots = new SqlParameter("@DepotNo", depono);
SqlParameter parDepartment = new SqlParameter("@DepartmentID", department);
SqlParameter parDate = new SqlParameter("@DateTo",attdate);
SqlHelper.FillDatatable(conn
, CommandType.StoredProcedure
, StoredProcedureConstants.GET_DEPOT_MISSING_ATT_POPUP
, dtMissingDates
, MTSGOConstants.DEFAULT_COMMAND_TIME_OUT
, parUserId
, parDepots
, parDepartment
,parDate);