I am learning ASP.NET framework. I have created a simple To Do List with React.js on the front end, and ASP.NET Core on the backend. It seems I am connecting to the database with no problems. But I have added a simple table to the server for the purposes of testing the connection which look something like this:
1 Create a To Do List
but when I launch the app on localhost, nothing is displayed, as depicted in this picture loading..., which suggests the back end is not functioning properly. Here is my connection string: "DBConString": "jdbc:sqlserver://localhost;database=master" and other relevant connection info```
{
services.AddControllersWithViews();
var ConnectionString = Configuration.GetConnectionString("DBConString");
services.AddDbContext<ToDoListDBContext>(options =>
options.UseSqlServer(ConnectionString));
services.AddMvc();
services.AddCors();```
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=ToDosController}/{action=Index}/{id?}");
});
Also some screenshots that show my successful connection to the database in my IDE: successful connection to database in Rider If anyone could share some insight into why this is not working, it'd be much appreciated!
"data source=localhost;initial catalog=master;integrated security=True;"'integrated security' unless you have SQL Server Authentication - with a specific user/pass set (e.g., sa and sa's password in your case to use master). You'll also want to take a look at this to use a transient scope: stackoverflow.com/questions/41923804/…