C# access database
Hi, I’m currently working on a project and my database lets me register and it will upload to the table perfectly fine but I go to login and it doesn’t exist. The user id is incrementing perfectly and the hashed password should be working fine. So I can’t find the issue and I’m unsure why the program won’t log in. I’m very new to this and I’m very stuck has anyone got any ideas? I’m happy to give more information. I have spent so many hours trying to fix this it’s unbelievable!
14 Replies
showing code and error messages for context would be a good start
$ask
How to get the best help :catpog:
Make a post in #help or one of the topic channels under Development.
Avoid asking
:catthinking: Can anybody help me?
:catthinking: Has anyone used XYZ?
:catthinking: Why doesn't my code work?
C# is a big area! No one knows they can help unless you tell them about the small area you're trying to work in.
Explain what you are doing, and potentially why for as much context as possible. Avoid screenshots where possible, share code directly in Discord. Type
$code
into chat to learn how to post code.
See https://www.nohello.net and https://dontasktoask.com if you want common help chat room etiquette.$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
For longer snippets, use: https://paste.mod.gg/My register form:
My login form :
My actual database :
and what error do you get when you try to connect to it?
I go to login and firstly on load up of my program is comes up with the message box that no user is logged in even though I do have users logged in on my database. And once I go to to login with the create credentials it shows Database connection established successfully, and this this error:
I know my database data is fetching correctly as if I go to register with a previous username it says it’s already used.
you should be debugging this to find out exactly what error is being thrown and what line is doing it
i have been its not throwing an exact error? I think somewhere the userID is being reverted back to 0 but im unsure where this could even be. Ive went through it step by step debugging and the CurrentUserID variable has been correct
have you checked logs on your database to see if it has any info?
probably something wrong with your query, but I've never used oledb before
oh okay thankyou for your help ill double check my query and ill have a look at the logs