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 HussainPosted Jul 27, 2013, 9:41 AM
don't use break
Regards,
Iftikar
Fuhans Puji SaputraPosted Jul 27, 2013, 11:36 AM
Thank you sir for your time.
Sincerely,
Fuhans
Iftikar HussainPosted Jul 27, 2013, 11:32 AM
Regards,
Iftikar
Fuhans Puji SaputraPosted Jul 27, 2013, 11:24 AM
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 HussainPosted Jul 27, 2013, 11:12 AM
Regards,
Iftikar
Fuhans Puji SaputraPosted Jul 27, 2013, 10:43 AM
Fuhans Puji SaputraPosted Jul 27, 2013, 9:20 AM
Here is the complete code "Sell System.rar"
Iftikar HussainPosted Jul 27, 2013, 8:51 AM
Regards,
Iftikar
Fuhans Puji SaputraPosted Jul 27, 2013, 8:48 AM
and still nothing happened, the error still same, at close bracket on:
Iftikar HussainPosted Jul 27, 2013, 7:23 AM
Regards,
Iftikar
Fuhans Puji SaputraPosted Jul 27, 2013, 7:16 AM
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.
om prakashPosted Jul 27, 2013, 3:43 AM
I am not sure why your using collection of collection of textbox. You can just do like this
conn.Close();
Iftikar HussainPosted Jul 27, 2013, 3:39 AM
I am not sure why your using collection of collection of textbox. You can just do like this
conn.Close();
Regards.
Iftikar
Fuhans Puji SaputraPosted Jul 27, 2013, 2:36 AM
and i already attach the files.rar, everything are inside it.
Please look at it.
Thank you
VijayPosted Jul 27, 2013, 2:36 AM
Fuhans Puji SaputraPosted Jul 27, 2013, 2:22 AM
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
om prakashPosted Jul 27, 2013, 1:23 AM
Thanks
Prakash