C
C#10mo ago
Cumet

✅ Model view controller web app + SQL

hi im tryna make a signup page but the details i etner dont get uploaded to my sql database
No description
39 Replies
Cumet
CumetOP10mo ago
Cumet
CumetOP10mo ago
heres the signup controller im using @ZZZZZZZZZZZZZZZZZZZZZZZZZ i moved to the more recent version now but have some issues
gwon8266
gwon826610mo ago
Why don't you want to use Entity framework?
Cumet
CumetOP10mo ago
its old af and i was struggling with it a lot even in connecting css with the cshtml files but i had the databse there working fine
gwon8266
gwon826610mo ago
You can still use dbContext to execute raw queries if you wanted to
Cumet
CumetOP10mo ago
whats that? in entity frameorrk or the one im using ?
gwon8266
gwon826610mo ago
entity framework
SinFluxx
SinFluxx10mo ago
I think there's some confusion, based on @Cumet 's last thread, I think they think you're talking about .NET framework
leowest
leowest10mo ago
@Cumet why dont u add some logs to your code so that u know if its even reaching your sql query in first place do u even know if it hits the query at all if it fails?
Cumet
CumetOP10mo ago
nope
leowest
leowest10mo ago
well then add some logging first
Cumet
CumetOP10mo ago
i'd like to but how can i add that
leowest
leowest10mo ago
Logging in .NET Core and ASP.NET Core
Learn how to use the logging framework provided by the Microsoft.Extensions.Logging NuGet package.
leowest
leowest10mo ago
alternatively u can just $debug your code
MODiX
MODiX10mo ago
Tutorial: Debug C# code and inspect data - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
leowest
leowest10mo ago
if its running in your pc the later might be simpler to do
Cumet
CumetOP10mo ago
ok thx ill check ito ut
leowest
leowest10mo ago
@Cumet are u ok, did u find the issue? were u able to debug/add the logger are u stuck?
Cumet
CumetOP10mo ago
It worked yes Thanks
leowest
leowest10mo ago
nice glad to hear u were able to solve it 🙂
Cumet
CumetOP10mo ago
I'm just stressed af tho 💀 Thx
leowest
leowest10mo ago
its ok since u were gone thou u just gave up or something
Cumet
CumetOP10mo ago
We have until 31 March to finish the project and they didn't even finish teaching us c# and all the labs needed 😿
leowest
leowest10mo ago
welcome to college/uni where teachers be teachers
Cumet
CumetOP10mo ago
Lmao
leowest
leowest10mo ago
just be glad they didn't tell u to use webforms anyway throw a /close if ur fine with closing this request 😉
Cumet
CumetOP10mo ago
Idk what that is but I don't think it can be worse than this 💀 Ight Can i keep it for future questions i might have some soon or do i need to open new one for new question@leowest
leowest
leowest10mo ago
sure if its related to this, otherwise u can always open a thre #help either is fine some ancient web tech
Cumet
CumetOP10mo ago
Ty @leowest hi are u free rn and can help ? i want to make a login page now and dont know where to start from (mostly getting confused of how i can fitch details from the databse) in order to check if they're valid or not etc... i already finished the signup page too
leowest
leowest10mo ago
if its something I know... but whenever u @ some one for help, please do post the question and details before ahead 😉
Cumet
CumetOP10mo ago
ok so ill create a new controller called signin but then idk how to do anything with pulling datafrom the database if any1 know where i can find info or can tell me where to start from ill appericate it
leowest
leowest10mo ago
well normally you use DI (dependency injection) to provide what is needed
Cumet
CumetOP10mo ago
like these?
No description
Cumet
CumetOP10mo ago
istg uni is useless af did not learn that yet
leowest
leowest10mo ago
yeah basically you register a service in your di that your controller can then request could be db, or some api or something else
Cumet
CumetOP10mo ago
ight ill work on it for a bit then go bed cuz its 4 am lol
leowest
leowest10mo ago
yeah no worries
leowest
leowest10mo ago
Dependency injection into controllers in ASP.NET Core
Discover how ASP.NET Core MVC controllers request their dependencies explicitly via their constructors with dependency injection in ASP.NET Core.
Cumet
CumetOP10mo ago
ty
Want results from more Discord servers?
Add your server