C
C#3mo 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
Cumet3mo ago
heres the signup controller im using @ZZZZZZZZZZZZZZZZZZZZZZZZZ i moved to the more recent version now but have some issues
gwon8266
gwon82663mo ago
Why don't you want to use Entity framework?
Cumet
Cumet3mo 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
gwon82663mo ago
You can still use dbContext to execute raw queries if you wanted to
Cumet
Cumet3mo ago
whats that? in entity frameorrk or the one im using ?
gwon8266
gwon82663mo ago
entity framework
SinFluxx
SinFluxx3mo ago
I think there's some confusion, based on @Cumet 's last thread, I think they think you're talking about .NET framework
leowest
leowest3mo 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
Cumet3mo ago
nope
leowest
leowest3mo ago
well then add some logging first
Cumet
Cumet3mo ago
i'd like to but how can i add that
leowest
leowest3mo 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
leowest3mo ago
alternatively u can just $debug your code
MODiX
MODiX3mo 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
leowest3mo ago
if its running in your pc the later might be simpler to do
Cumet
Cumet3mo ago
ok thx ill check ito ut
leowest
leowest3mo ago
@Cumet are u ok, did u find the issue? were u able to debug/add the logger are u stuck?
Cumet
Cumet3mo ago
It worked yes Thanks
leowest
leowest3mo ago
nice glad to hear u were able to solve it 🙂
Cumet
Cumet3mo ago
I'm just stressed af tho 💀 Thx
leowest
leowest3mo ago
its ok since u were gone thou u just gave up or something
Cumet
Cumet3mo 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
leowest3mo ago
welcome to college/uni where teachers be teachers
Cumet
Cumet3mo ago
Lmao
leowest
leowest3mo ago
just be glad they didn't tell u to use webforms anyway throw a /close if ur fine with closing this request 😉
Cumet
Cumet3mo 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
leowest3mo ago
sure if its related to this, otherwise u can always open a thre #help either is fine some ancient web tech
Cumet
Cumet3mo 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
leowest3mo ago
if its something I know... but whenever u @ some one for help, please do post the question and details before ahead 😉
Cumet
Cumet3mo 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
leowest3mo ago
well normally you use DI (dependency injection) to provide what is needed
Cumet
Cumet3mo ago
like these?
No description
Cumet
Cumet3mo ago
istg uni is useless af did not learn that yet
leowest
leowest3mo 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
Cumet3mo ago
ight ill work on it for a bit then go bed cuz its 4 am lol
leowest
leowest3mo ago
yeah no worries
leowest
leowest3mo 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
Cumet3mo ago
ty