72 Replies
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
this confuses me
which line
The one above
okay
i dont understand how i would fix it
Call the method on this instance
Not on the class itself
like that
Yes
okay
But, the method also needs some parameters
It wants an instance of
UserDetails
, namelyi did these
what does namely mean
"To be precise, to use a proper name here instead of refering to it vaguely, it wants an instance of
UserDetails
"Which you created here
i dont understand what i need to do
i am quite new at this
If you're new to this, you shouldn't be trying to connect to a database from a Winforms app
it works
Let me recommend $helloworld
it is a project due on saturday
so i have to do this for 20% of my grade
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 onewhat does instance mean
like to define it?
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
ahh okay
@jiniux
can you help me
what is the problem?
at the top
idk how to fix it at all
I told you exactly how?
idk what instanciate means
idk what to instanciate
and idk where
or what class
So you resorted to pinging random people instead of asking lmao
probably pinged me because i helped them some days 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
idk how to do that
Method(parameter)
Angius
REPL Result: Success
Console Output
Compile: 396.546ms | Execution: 22.056ms | React with ❌ to remove this embed.
Here, I am passing
text
to the WriteLine()
methodso i need to do UserConfirmed(parameter)
Yes
The parameter needs to be an instance of
UserDetails
im not too sure where to do this
Yes, the method tells you exactly what the parameter should be
UserDetailsBindingSource.DataSource = userDetails.DAO.UserConfirmed(userDetails)
You have an instance of user details
Pass that to the method
idk how to do that
so
i do
userdetails
is a variable that stores the instance of UserDetails
userDetails
variable does not exist
C# is case-sensitiveohh okay the error is gone now
thank you
does you know what this means
my database is called loginpage
The table is called
userdetails
thoughi changed this
Yes
i changed the loginpage to usersdetails
The database is called
loginpage
The table is called userdetails
You connect to the database loginpage
Then you have to query the table userdetails
is that through the sql statement
now its saying it can't find password but they're all called the same thing and the other one works
Well, does your table have a column named
Password
?yes
Spot the difference
omg it works now
thank you
sweat and tears gone