VB updating access DB but not getting correct result in datagrid view after refreshin

Alkan

New member
Joined
Mar 18, 2009
Messages
3
Programming Experience
1-3
Thanks if anyone has help
I am connecting to a microsoft access database which works fine.......i am then using a data grid view tool to view information from the database, which also works fine, when i update the database and click on the same button to display the information in the data grid view i see all required columns, but with the primary key values coming from somewhere i hae never seen?

Can anyone help?

If so thank you
 
If you have an identity seed column, your dataset/table may have set this to increment by -1 for new records. This then is changed once you update the data adapter inserting the new records to the database. Since you didnt mention what your actually seeing, I'm guessing this may be it, records that you are creating at run time and adding to your dataset/table but have not yet committed to the database. If it is not, please explain further.
 
Hi Tom Thanks for you quick reply.

i am basicly creating a multimedia player application, my database has music table, and video table. when i click the "music" button on the application it retrieves the data from that table in to the data grid.

when i then press my open button i have created, it shows a dialog box, i can then sleect a music file which then adds to the database and plays on my windows media player API..

when i then go back to click on my "music" button to show me that the file added to the database, it then gives me all the column names, but only the primary key colum is filled in with values, but where these values are coming from i have no idea?

i created the project from scratch again using the database, and it appeared the same? does this mean the values are stored in the database, and where?
:confused:

the file once selected does actually update to the database but when i go to look at it in my datagrid view tool it shows as mentioned above


Thanks

Alkan
 
Last edited:
when i then go back to click on my "music" button to show me that the file added to the database, it then gives me all the column names, but only the primary key colum is filled in with values, but where these values are coming from i have no idea?

What is being shown as the values in the primary key fields?

All the other columns/fields are showing as null values in the datagridview; are these same record fields null in the actual database or do they have data?
 
Please post your project in a zip. DO NOT INCLUDE the bin or obj folders; delete them before you zip. VS will remake them when you reopen it (close it first)
 
What is being shown as the values in the primary key fields?

All the other columns/fields are showing as null values in the datagridview; are these same record fields null in the actual database or do they have data?


well the values being shown are not even in the database.....

the datagrid shows null for the other fields but they are not null in the database?
 
Its hard to guess at all that your program might be doing. As CJ says, try posting your project so we can look at it and find the actual problem.
 
well the values being shown are not even in the database.....

the datagrid shows null for the other fields but they are not null in the database?

SOunds like your sourcecolumn bindings are wrong. Post your project
 

Latest posts

Back
Top