C
C#10mo ago
jourmonheimer

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
Mango10mo ago
In C# I assume?
jourmonheimer
jourmonheimerOP10mo ago
Yes Windows fourms Double click the login button and what should I do from there databases and tables all made
Mango
Mango10mo 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
jourmonheimerOP10mo ago
What is ado and asl
Mango
Mango10mo ago
Ignore that part Google how to make a sql connection to a database
jourmonheimer
jourmonheimerOP10mo 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
Mango10mo ago
Not really
jourmonheimer
jourmonheimerOP10mo 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
Kao10mo 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
jourmonheimerOP10mo 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
Kao10mo 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
jourmonheimerOP10mo ago
It won't be adding any new usernames and passwords
Kao
Kao10mo ago
And I haven't implied that haha
jourmonheimer
jourmonheimerOP10mo 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
Kao10mo 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
jourmonheimerOP10mo ago
Say it's one forum that comes after the login Can I have a code please
Kao
Kao10mo 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
jourmonheimerOP10mo 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
Kao10mo 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
jourmonheimerOP10mo 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
Kao10mo 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
jourmonheimerOP10mo 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
Kao10mo 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
jourmonheimerOP10mo ago
Isn't code all the same Mines prolly simpler even Why do programers hate teaching beginners
ACE OF SPADES
ACE OF SPADES10mo ago
they didnt want a spoonfeed cause everyone are want a copy and paste 😄
Kao
Kao10mo 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 SPADES10mo ago
thats why a coder, there`s a different method for making a code and optimize a work
Kao
Kao10mo 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
jourmonheimerOP10mo ago
It's literally just username and password Fine
Kao
Kao10mo ago
Then I literally told you what you have to do. You are refusing the answer, it's different.
jourmonheimer
jourmonheimerOP10mo 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
Kao10mo 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
jourmonheimerOP10mo ago
I will hurt myself I'm going to study and fail now Thanks somewhat
ACE OF SPADES
ACE OF SPADES10mo ago
thats a part of life man, you didn`t learn when you are not getting failed
jourmonheimer
jourmonheimerOP10mo 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
jourmonheimerOP10mo ago
No description
jourmonheimer
jourmonheimerOP10mo ago
Now will someone help me? Please
Mordeo
Mordeo10mo 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
jourmonheimerOP10mo 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
Mango10mo 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
Mango10mo ago
Shows all the various options for connection strings
Mango
Mango10mo 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
jourmonheimerOP10mo ago
Thank you
Mordeo
Mordeo10mo ago
The exception tells you which field is unsupported
jourmonheimer
jourmonheimerOP10mo 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 (⁠つ⁠✧⁠ω⁠✧⁠)⁠つ
Want results from more Discord servers?
Add your server