Answer the question
In order to leave comments, you need to log in
How to connect .net mvc to mysql server via connectionstrings?
I have this ConnectionString
<connectionStrings>
<add name="conn" providerName="MySql.Data.MySqlClient"
connectionString="server=localhost;UserId=root;Password=;database=testapi;CharSet=utf8_general_ci;Persist Security Info=True" />
</connectionStrings>
public IEnumerable<Test> GetTests()
{
return context.Tests;
}
function GetAllTests() {
$("#createBlock").css('display', 'block');
$("#editBlock").css('display', 'none');
$.ajax({
url: '@Url.Action("Values","Api")',
type: 'GET',
dataType: 'json',
success: function (data) {
WriteResponse(data);
}
});
}
Answer the question
In order to leave comments, you need to log in
Found a solution, it was necessary to migrate the database through enable-migrations, add-migration, update-database
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question