do i need classes or mvp

I have made the forum and the database and connected the database to the project but that's how far I gone I don't know what code I should add to the login button to make it work from SQL server, please help me I need this before Monday
45 Replies
Mango
Mango4mo ago
In C# I assume?
jourmonheimer
jourmonheimer4mo ago
Yes Windows fourms Double click the login button and what should I do from there databases and tables all made
Mango
Mango4mo ago
Introduction to Microsoft.Data.SqlClient namespace - ADO.NET Provid...
Learn about the Microsoft.Data.SqlClient namespace and how it's the preferred way to connect to SQL for .NET applications.
jourmonheimer
jourmonheimer4mo ago
What is ado and asl
Mango
Mango4mo ago
Ignore that part Google how to make a sql connection to a database
jourmonheimer
jourmonheimer4mo ago
Alright hold on Im lost It's so much stuff is there one where it just says to connect a button to a table
Mango
Mango4mo ago
Not really
jourmonheimer
jourmonheimer4mo ago
Alright how about this, how do I change forums after loging through Like if statement rows zero thing hide forum open the other I just started like end of December please be patient with me
Kao
Kao4mo ago
But hasn't your teacher shown you how to do stuff? Feels weird you have to do db stuff without having at least a little lesson on how to make db connections in .NET
jourmonheimer
jourmonheimer4mo ago
My teacher shows up twice a week warms a chair and leaves Ikr He said it's very simple One project make a database management system Is that more clearer
Kao
Kao4mo ago
The idea is that you have a user object that gets populated when logged-in that you then can use through your app to do stuff
jourmonheimer
jourmonheimer4mo ago
It won't be adding any new usernames and passwords
Kao
Kao4mo ago
And I haven't implied that haha
jourmonheimer
jourmonheimer4mo ago
There has to be a simple code to just check those two and let pass to another forum right Please I'm so new to this if you cut me I'm pale green
Kao
Kao4mo ago
A login form is just that: Check if username exists in database If it exists check that passwords hash are the same If yes, connect the user and fill the user object for that user session (getting data from the database still) Now my web pages can use that object. Checking it's not null, getting the username out of it, whatever it contains, to make custom pages for the user
jourmonheimer
jourmonheimer4mo ago
Say it's one forum that comes after the login Can I have a code please
Kao
Kao4mo ago
I don't do spoon feeding I'm very sorry, it won't help you in the long run. I can help you thinking about the logic, I can also help on code you have produced, but won't give you code
jourmonheimer
jourmonheimer4mo ago
But like how am I supposed to find it if I don't know the code to use Like sqlcommand I don't know when to use that
Kao
Kao4mo ago
The link above kinda tells you Sql command is when you want to interact with the database Like, sending a SELECT query (or an insert) For example for the login part, you would need a sqlcommand to check that the username exists
jourmonheimer
jourmonheimer4mo ago
Are you telling me to study them all Please can't you make an exception I have only tomorrow now and I told myself I won't sleep till I make atleast the login It's ten thirty I'm going to cry
Kao
Kao4mo ago
I mean... that's kinda the purpose of studies. When was the assignment given to you? Not really and I also have other things to do than doing someone else code :/ Like, really, if you wish to become a dev, you need to do that yourself And you would learn more from a failure than from someone handing you a solution
jourmonheimer
jourmonheimer4mo ago
You don't understand I'm forced to do c# and SQL for marks I don't know what's happening all I know is I will be hurt on Monday I found this server in a rush even Please please just the login
Kao
Kao4mo ago
I'm really sorry if you're stuck on something you don't want to study then. But I also really don't have the time to code for you. I gave you the "algorithm" of a login. You gotta try from that. You can also try getting help from your schoolmates. But really can't help you more than what I'm doing here
jourmonheimer
jourmonheimer4mo ago
Isn't code all the same Mines prolly simpler even Why do programers hate teaching beginners
ACE OF SPADES
ACE OF SPADES4mo ago
they didnt want a spoonfeed cause everyone are want a copy and paste 😄
Kao
Kao4mo ago
I don't hate teaching. You aren't asking for teaching. You are asking for solution. That is the opposite of teaching. And no all codes aren't the same
ACE OF SPADES
ACE OF SPADES4mo ago
thats why a coder, there`s a different method for making a code and optimize a work
Kao
Kao4mo ago
And even if I had time to code for you I don't even know how your database looks like. So I could not code the login for you. I feel like I've been very kind to you and trying to guide you to the solution
jourmonheimer
jourmonheimer4mo ago
It's literally just username and password Fine
Kao
Kao4mo ago
Then I literally told you what you have to do. You are refusing the answer, it's different.
jourmonheimer
jourmonheimer4mo ago
I'll make the login I'll study that big site thing and I'll make it by myself And if I do that you have to help me for the rest
Kao
Kao4mo ago
Now if you produce code and have issues with it, you can ask help with that, and we would help. I'll just never give you a spoon-fed solution And in the end you'll be proud of yourself because you understood the thing and did it by yourself
jourmonheimer
jourmonheimer4mo ago
I will hurt myself I'm going to study and fail now Thanks somewhat
ACE OF SPADES
ACE OF SPADES4mo ago
thats a part of life man, you didn`t learn when you are not getting failed
jourmonheimer
jourmonheimer4mo ago
Alright @Kao I have a error Please it's so early I fixed them all but now it says SQL server certificate something
jourmonheimer
jourmonheimer4mo ago
No description
jourmonheimer
jourmonheimer4mo ago
Now will someone help me? Please
Mordeo
Mordeo4mo ago
The exception is very clear. That's not a supported keyword in a SQL server connection string Have you tried searching what the correct keyword should be?
jourmonheimer
jourmonheimer4mo ago
I don't think YouTube has it What I did was I copied the string from the database Alright so it could be two things It says initial catalog where I Think it should be the server name And it says "keyword not supported" that's the other Is initial catalog supposed to be there
Mango
Mango4mo ago
Microsoft SqlClient Data Provider for SQL Server Connection Strings...
Connection Strings using Microsoft.Data.SqlClient for connections to SQL Server, Azure SQL Database, SQL Server 2019, SQL Server 2017, SQL Server 2016.
Mango
Mango4mo ago
Shows all the various options for connection strings
Mango
Mango4mo ago
SqlConnectionStringBuilder Class (System.Data.SqlClient)
Provides a simple way to create and manage the contents of connection strings used by the SqlConnection class.
jourmonheimer
jourmonheimer4mo ago
Thank you
Mordeo
Mordeo4mo ago
The exception tells you which field is unsupported
jourmonheimer
jourmonheimer4mo ago
I love you It was stupid two spaces in between It works now Thank you all of you There's no emoji to show how much I am happy right now (⁠つ⁠✧⁠ω⁠✧⁠)⁠つ