diff --git a/asg_form/Controllers/Budget/BgCountController.cs b/asg_form/Controllers/Budget/BgCountController.cs index 8f77230..2b5d292 100644 --- a/asg_form/Controllers/Budget/BgCountController.cs +++ b/asg_form/Controllers/Budget/BgCountController.cs @@ -1,4 +1,4 @@ -/*using asg_form.Controllers.Teamregistration; +using asg_form.Controllers.Teamregistration; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; @@ -91,4 +91,3 @@ namespace asg_form.Controllers.Budget } } } -*/ \ No newline at end of file diff --git a/asg_form/Controllers/Dbset.cs b/asg_form/Controllers/Dbset.cs index 90d5949..c0a8f9e 100644 --- a/asg_form/Controllers/Dbset.cs +++ b/asg_form/Controllers/Dbset.cs @@ -1,5 +1,5 @@  -//using asg_form.Controllers.Budget; +using asg_form.Controllers.Budget; using asg_form.Controllers.Store; using asg_form.Controllers.Team; using asg_form.Controllers.Teamregistration; @@ -240,12 +240,12 @@ namespace asg_form.Controllers public DbSet T_config { get; set; } public DbSet T_Task { get; set; } public DbSet T_Comform { get; set; } - //public DbSet budgetDetails { get; set; } + public DbSet budgetDetails { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - string connStr = @"Host=localhost;Port=2345;Database=postgres;Username=postgres;Password=luolan12323;"; - optionsBuilder.UseNpgsql(connStr); + string connStr = @"Server=localhost\SQLEXPRESS;Database=master;Trusted_Connection=True;TrustServerCertificate=true"; + optionsBuilder.UseSqlServer(connStr); } protected override void OnModelCreating(ModelBuilder modelBuilder) diff --git a/asg_form/Program.cs b/asg_form/Program.cs index 0232e5a..5429906 100644 --- a/asg_form/Program.cs +++ b/asg_form/Program.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Options; using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; using Mirai.Net.Sessions; @@ -81,8 +80,8 @@ IServiceCollection services = builder.Services; services.AddDbContext(opt => { - string connStr = @"Host=localhost;Port=2345;Database=postgres;Username=postgres;Password=luolan12323;"; - opt.UseNpgsql(connStr); + string connStr = @"Server=localhost\SQLEXPRESS;Database=master;Trusted_Connection=True;TrustServerCertificate=true"; + opt.UseSqlServer(connStr); }); services.AddHostedService(); diff --git a/asg_form/asg_form.csproj b/asg_form/asg_form.csproj index 9054eaf..12f488a 100644 --- a/asg_form/asg_form.csproj +++ b/asg_form/asg_form.csproj @@ -27,7 +27,7 @@ - + @@ -48,13 +48,12 @@ - - +