C
C#13mo ago
randombev

✅ How to create a database for an application on mac?

The application’s purpose is to allow entry and editing of customer details
39 Replies
Angius
Angius13mo ago
What kind of a database? SQLIte? PostgreSQL? SQL Server?
randombev
randombevOP13mo ago
for dotnet project i am using visual studio for mac atm
x0rld 👻 🎃
x0rld 👻 🎃13mo ago
you have to chose a database engine
Angius
Angius13mo ago
A dotnet project can use any database So, again, which one?
randombev
randombevOP13mo ago
i tried using XAMPP and phpmyadmin
Angius
Angius13mo ago
Yes, you can run a MySQL database through XAMPP
randombev
randombevOP13mo ago
but I cant follow at 17.40 tried using chatgpt but still i got this error "Option 'cache' not supported"
PhantomRow
PhantomRow13mo ago
You can try Mssql management studio for mac? Setup? Maybe ? for mssql tsql
randombev
randombevOP13mo ago
i think I have to be in "(base)" in terminal? not im not sure how
x0rld 👻 🎃
x0rld 👻 🎃13mo ago
show how your register your dbcontext
Angius
Angius13mo ago
You need to be in your project's directory In the project that has the DbContext, to be more precise
randombev
randombevOP13mo ago
using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using ardonagh.Data; var builder = WebApplication.CreateBuilder(args); // Add services to the container. var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found."); //builder.Services.AddDbContext<ApplicationDbContext>(options => // options.UseSqlite(connectionString)); builder.Services.AddDbContextPool<ApplicationDbContext>(options => options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString))); builder.Services.AddDatabaseDeveloperPageExceptionFilter(); builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true) .AddEntityFrameworkStores<ApplicationDbContext>(); builder.Services.AddControllersWithViews(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseMigrationsEndPoint(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); app.MapRazorPages(); app.Run();
Bing
The birthplace of Western philosophy
On World Philosophy Day, we're in Athens, the capi
x0rld 👻 🎃
x0rld 👻 🎃13mo ago
what's your connection string ?
randombev
randombevOP13mo ago
No description
Angius
Angius13mo ago
That seems fine What is the exact error you're getting?
MODiX
MODiX13mo ago
bernicefy#1744
i am using visual studio for mac atm
React with ❌ to remove this embed.
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Angius
Angius13mo ago
Should have no bearing on the errors thrown from a dotnet tool ran via CLI, should it? But, yeah, VS4Mac is dead
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
x0rld 👻 🎃
x0rld 👻 🎃13mo ago
the devkit vscode extension has been release btw
jcotton42
jcotton4213mo ago
SSMS does not exist for macOS closest thing would be Azure Data Studio
randombev
randombevOP13mo ago
this is the error after i enter "dotnet ef migrations add Customer" Will it fix the problem if i switch to Azure Data Studio instead of XAMPP?
x0rld 👻 🎃
x0rld 👻 🎃13mo ago
no
jcotton42
jcotton4213mo ago
ADS is a database client not a database engine
randombev
randombevOP13mo ago
hmm.. so what should I do? I am stuck here..
x0rld 👻 🎃
x0rld 👻 🎃13mo ago
what's the line 13 ?
randombev
randombevOP13mo ago
No description
x0rld 👻 🎃
x0rld 👻 🎃13mo ago
try removing it
randombev
randombevOP13mo ago
still the same error is this the cause of the problem?
Angius
Angius13mo ago
No, unlikely
randombev
randombevOP13mo ago
so it's a a database engine problem?
Angius
Angius13mo ago
It seems that way, yeah Like MySQL wasn't supporting whatever option What version of MySQL do you have installed?
randombev
randombevOP13mo ago
AHHH thank youuuu for reminding its working now :'))
x0rld 👻 🎃
x0rld 👻 🎃13mo ago
what did you change ?
randombev
randombevOP13mo ago
SQL connection From MySQL Workbench
x0rld 👻 🎃
x0rld 👻 🎃13mo ago
oh the connectionstring ?
randombev
randombevOP13mo ago
yup
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server