1

I need help.
im making a program and
im using an access database
and i want to make it so that the user's input is to be searched from two different tables in one Access file.

thank you for reading and sorry if my english is abit shaky

Comments
  • 3
    People still use access?
  • 3
    First, use an OleDbParameter so people can't inject sql...and unless you really intend to set the label text multiple times you don't need to read the first datareader in a while loop. Also, since you're selecting by id_no, the "txtidno.Text = dr.("id_no").ToString" check is unnecessary. But, to the problem at hand...I can't see the rest of your code and don't know your table structure, but it seems like you should just be joining the two tables by id_no or using a union with distinct since it looks like all you're looking for is the student's personal info. If you really need to iterate two datareaders at the same time, you might need to use two separate connection objects. I haven't used Access in a while, but I know with Oracle that will throw an exeception, and same for MySql unless you enable MultipleActiveResultSets. Sorry if that came off like a stackoverflow post lol
  • 1
    @soohoonigan

    What you meant to say was; devrant is not fucking stackoverflow.

    Kk tvym ask SO
  • 1
    no it's fine :) infact, you helped lots! ive managed to fix it up abit. @soohoonigan
  • 0
    Please use stackoverflow or ask in devrant discord server.
Add Comment