Visual Studio C#: How to check a value against Access table?

VAer-4038 776 Reputation points
2020-12-31T04:12:25.427+00:00
 private void btnConnect_Click(object sender, EventArgs e)
        {
            //I have an Access file, file path: C:\Users\QR\Documents\UserDatabase.accdb ; file password is: Pa$$word123;
            //The access file has a table called User, and the table has a field called UserID (Employee UserID is unique, it is work PC, employee userID is same as Environment.UserName)
            //If Environment.UserName is not in the table, then it is first time that the person uses this application, and it will loop to another Registration form.

        }

I will need to write code to check if Environment.UserName is not in the table , how do write it? In general, I have no idea how to connect Visual Studio to Access database.

Thanks.

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.

0 comments No comments

1 answer

Sort by: Newest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.