Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

my MySQL connection is not working after I convert my project from netcore 2.1 to 3.1

$
0
0

hi all

I was using this connection string with NetCore 2.0

"EvrakaConnection": "server=MyServer;port=3306;database=MyDB;user=root;password=MyPW;Charset=latin5"

Then in startup

var connection = Configuration.GetConnectionString("EvrakaConnection");
services.AddDbContext<EvrakaContext>((serviceProvider, optionsBuilder) =>
{
optionsBuilder.UseMySQL(connection).UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);
});

It was working,

Now I converted my project into netcore 3.1 and it seems it has problems because it gives 

System.NullReferenceException: 'Object reference not set to an instance of an object.'

_context was null.

error.

Can you help me to solve this please.


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>