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