Here is my case:
I have created 2 form which is login form, which username textbox already connected to the database and it is successfully.
When user login, it direct to the second form, and in the second form, there are multiple textbox that i have created using Array List, and it has shown.
Here is my problem:
I want to connect the textboxes in second form to the database, but it shown nothing when i run the program, i already trace the code which is the error, and the error is on when OleDBDataReader is reading, i dunno what's wrong with my code, in login form it run perfectly, but in the second form, there is an error.
Here is the link image for Login Form:https://www.dropbox.com/s/5q8pyztqy7ejupy/Capture.PNG
Here is the link image for Second Form:
https://www.dropbox.com/s/khsvh5bf1dc4c8u/Capture_2.PNG
Here is the link code for Second Form:
https://www.dropbox.com/s/rval228qyo2mwbj/Code%20for%20Second%20Form_2.docx
For the Second Form, in the column of code, it supposed to shown the autocomplete like at the Login Form.
Thank you.
Loading

Iftikar HussainRank #423 · 5.9K reputationPosted Jul 27, 2013, 5:41 AM EDT
don't use break
Regards,
Iftikar
om prakashRank #5,816 · 285 reputationPosted Jul 26, 2013, 9:23 PM EDT
Thanks
Prakash
Fuhans Puji Saputra17 reputationPosted Jul 26, 2013, 10:22 PM EDT
But one question, why do i need to use datawriter on each textbox to connect it to the database?
i don't use datawriter on the textbox, only use datareader, and it went perfectly.
But that's for Login Form only, but for Second Form, i had problem to connect multiple textboxes to the database.
Please click the link that i have given in the question.
Thank you
Vijay134 reputationPosted Jul 26, 2013, 10:36 PM EDT
Fuhans Puji Saputra17 reputationPosted Jul 26, 2013, 10:36 PM EDT
and i already attach the files.rar, everything are inside it.
Please look at it.
Thank you
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 26, 2013, 11:39 PM EDT
I am not sure why your using collection of collection of textbox. You can just do like this
conn.Close();
Regards.
Iftikar
om prakashRank #5,816 · 285 reputationPosted Jul 26, 2013, 11:43 PM EDT
I am not sure why your using collection of collection of textbox. You can just do like this
conn.Close();
Fuhans Puji Saputra17 reputationPosted Jul 27, 2013, 3:16 AM EDT
I already try what are you suggest, but still there is an error.
The error is on close bracket in:
while (drReader.Read())
{
codesCollection.Add(dReader.GetString(0));
} <-- Here i trace on it by clicking the red dot, but nothing shown up (means there is an error right?), in Login Form i trace same thing what i did in Second Form, and the close bracket shown up, so there no error.
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 27, 2013, 3:23 AM EDT
Regards,
Iftikar
Fuhans Puji Saputra17 reputationPosted Jul 27, 2013, 4:48 AM EDT
and still nothing happened, the error still same, at close bracket on:
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 27, 2013, 4:51 AM EDT
Regards,
Iftikar
Fuhans Puji Saputra17 reputationPosted Jul 27, 2013, 5:20 AM EDT
Here is the complete code "Sell System.rar"
Fuhans Puji Saputra17 reputationPosted Jul 27, 2013, 6:43 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 27, 2013, 7:12 AM EDT
Regards,
Iftikar
Fuhans Puji Saputra17 reputationPosted Jul 27, 2013, 7:24 AM EDT
But, the autocomplete that is not working.
Correct me if i am wrong sir:
for the "Code", it is "number", not "text".
So, it is not working if i write the code "dReader["Code"].ToString()" instead of "dReader.GetInt32(0)"?
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 27, 2013, 7:32 AM EDT
Regards,
Iftikar
Fuhans Puji Saputra17 reputationPosted Jul 27, 2013, 7:36 AM EDT
Thank you sir for your time.
Sincerely,
Fuhans