C
C#Eve.

✅ Checking data from SQL database

help on verge of tears
No description
No description
A
Angius17d ago
The method is not static So you need to call it on an instance of the class You create one such instance on the line above
E
Eve.17d ago
this confuses me which line
A
Angius17d ago
No description
A
Angius17d ago
The one above
E
Eve.17d ago
okay i dont understand how i would fix it
A
Angius17d ago
Call the method on this instance Not on the class itself
E
Eve.17d ago
No description
E
Eve.17d ago
like that
A
Angius17d ago
Yes
E
Eve.17d ago
okay
A
Angius17d ago
But, the method also needs some parameters
E
Eve.17d ago
No description
A
Angius17d ago
It wants an instance of UserDetails, namely
No description
E
Eve.17d ago
i did these what does namely mean
A
Angius17d ago
"To be precise, to use a proper name here instead of refering to it vaguely, it wants an instance of UserDetails"
A
Angius17d ago
Which you created here
No description
E
Eve.17d ago
i dont understand what i need to do i am quite new at this
A
Angius17d ago
If you're new to this, you shouldn't be trying to connect to a database from a Winforms app
E
Eve.17d ago
it works
A
Angius17d ago
Let me recommend $helloworld
E
Eve.17d ago
it is a project due on saturday so i have to do this for 20% of my grade
A
Angius17d ago
And, to answer your question, if a method says it wants some parameter, you gice it that parameter This method wants an instance of UserDetails, so you should give it one
E
Eve.17d ago
what does instance mean like to define it?
A
Angius17d ago
No idea how to define it besides "instance is an instance" You instantiate classes with new What you get from new Foo() is an instance of class Foo
E
Eve.17d ago
ahh okay @jiniux can you help me
J
jiniux17d ago
what is the problem?
E
Eve.17d ago
at the top idk how to fix it at all
A
Angius17d ago
I told you exactly how?
E
Eve.17d ago
idk what instanciate means idk what to instanciate and idk where or what class
A
Angius17d ago
So you resorted to pinging random people instead of asking lmao
J
jiniux17d ago
probably pinged me because i helped them some days ago
A
Angius17d ago
To isntantiate means to create an instance You have all the necessary instances of all the necessary classes already made You even called the correct method on the correct instance Now, the method only needs a parameter You have the instance needed for that already This one Now just pass it as a parameter to your method
E
Eve.17d ago
idk how to do that
A
Angius17d ago
Method(parameter)
M
MODiX17d ago
Angius
REPL Result: Success
string text = "Hello World";
Console.WriteLine(text);
string text = "Hello World";
Console.WriteLine(text);
Console Output
Hello World
Hello World
Compile: 396.546ms | Execution: 22.056ms | React with ❌ to remove this embed.
A
Angius17d ago
Here, I am passing text to the WriteLine() method
E
Eve.17d ago
so i need to do UserConfirmed(parameter)
A
Angius17d ago
Yes
E
Eve.17d ago
No description
A
Angius17d ago
The parameter needs to be an instance of UserDetails
E
Eve.17d ago
No description
E
Eve.17d ago
im not too sure where to do this
A
Angius17d ago
Yes, the method tells you exactly what the parameter should be
No description
J
jiniux17d ago
UserDetailsBindingSource.DataSource = userDetails.DAO.UserConfirmed(userDetails)
A
Angius17d ago
You have an instance of user details
No description
A
Angius17d ago
Pass that to the method
E
Eve.17d ago
idk how to do that so i do
A
Angius17d ago
No description
E
Eve.17d ago
No description
A
Angius17d ago
userdetails is a variable that stores the instance of UserDetails userDetails variable does not exist C# is case-sensitive
E
Eve.17d ago
ohh okay the error is gone now thank you
E
Eve.17d ago
No description
E
Eve.17d ago
does you know what this means my database is called loginpage
E
Eve.17d ago
No description
A
Angius17d ago
The table is called userdetails though
E
Eve.17d ago
i changed this
No description
A
Angius17d ago
Yes
E
Eve.17d ago
i changed the loginpage to usersdetails
A
Angius17d ago
The database is called loginpage The table is called userdetails You connect to the database loginpage Then you have to query the table userdetails
A
Angius17d ago
No description
E
Eve.17d ago
is that through the sql statement
E
Eve.17d ago
No description
E
Eve.17d ago
No description
E
Eve.17d ago
now its saying it can't find password but they're all called the same thing and the other one works
A
Angius17d ago
Well, does your table have a column named Password?
E
Eve.17d ago
No description
E
Eve.17d ago
yes
A
Angius17d ago
No description
A
Angius17d ago
No description
A
Angius17d ago
Spot the difference
E
Eve.17d ago
omg it works now thank you sweat and tears gone
Want results from more Discord servers?
Add your server
More Posts
✅ How to export data from datagridview into excel fileI've tried like a few ways and cant really make sense of it, if someone can guide me through it it wProblem with Material Design Lib in wpfI have a Combobox item in Stack panel. Im using Material Desing for automatic styling but the Popup✅ Title: Issues with Authentication and Authorization using JWT with AutoRender Mode in Blazor NET8Hello friends, I am currently facing challenges with Authentication and Authorization using JWT wit✅ How do I reference a specific private instance of a classI would like to know how I could reference a specific instance of a class, if the class is private aReceiving Game Controller Input while Minimized (WinForms C#)Pretty general question here. How would I go about receiving input from my user while they aren't tprocess startIve been trying to figure out why the proccess.start() hasnt been working✅ Configurations say that appsettings is returning nullBasically, i have a configuration and i'm trying to access a value from my appsettings, and all that✅ ASP.NET Core Web Api + SignalRHi, I have an API deployed on IIS but when a person wants to access it they get an error: "ERR_CONNE✅ .NET sdk not workingSo, I've installed the .NET sdk and did what I was told, but it's still not being detected by vscodeMEF No exports were found that match the constraintHi, i'm trying to implement MEF in my WPF app, however i'm getting this error, not sure why anymore.✅ WPF - set UIElement (image) in XAML depending on databound Property Enum valueI am trying to dynamically change a StatusBar image via a view's XAML depending upon a databound VieASP.NET Controller API + Blazor Client UI resources and helpHello! I'm doing a side project where I created the backend API with simple CRUD functionality and A✅ Run PuppeteerSharp in Docker ContainerI have an endpoint that creates PDFs using PuppeteerSharp. I work fine locally because it can automaDocker + Blazor + MSSQL handshake errorWhen I run dotnet ef database update I get the following error : ``Microsoft.Data.SqlClient.SqlExceProblem with corner radius XAML propertyI use a border with these properties: ```<Border CornerRadius="3" Background="{StaticResource Edito✅ :white_check_mark: Dictionary<int, ...> lookup time seems a bit too slowI was profiling a program, and I saw this: ```cs 100 % HasObject • 136 ms • 189 217 Calls • Engine.Rhow to read .txt file next to the Program.csi have the following code that is begin run ```cs string fileContent = File.ReadAllText("hamlet.txt✅ Linker Error Trying to Build OpenSSL Static LinkingHello, I've been trying to compile and build OpenSSL to try and encrypt a text file using AES 256 buHow things get to the placeI have found this one thing by Microsoft that confused me so much ```cs public async Task<IActionResVisual code studio and msbuildim currently having problems while scripting apparently when i press (Run Build Task) im getting thi