I have DataGridView which is 'binded' to dataset table. When I add new field to the table from access ,that field not appears in the datagrid. I am looking a way to refresh datagrid columns.
- I was try to delete datagridvew and add new datagridview with the same properties,but still last field(column) is missing.
- I was try to add new column manually, and I was set property name corresponding to the new field name... but data is not shown.
15 Replies - 561 Views - Last Post: 07 February 2012 - 06:04 PM
Topic Sponsor:
Replies To: OleDb DataGridView binding problem
#2
Re: OleDb DataGridView binding problem
Posted 02 February 2012 - 07:52 AM
With Access you have to remove it and reload it into application when you make changes to tables, unlike SqlServer. Then you will see the changes.
#3
Re: OleDb DataGridView binding problem
Posted 02 February 2012 - 08:13 AM
#4
Re: OleDb DataGridView binding problem
Posted 02 February 2012 - 08:31 AM
Remove Access as the datasource, then use the wizard('Add Datasource') to find and add it.
#6
Re: OleDb DataGridView binding problem
Posted 06 February 2012 - 04:25 PM
_HAWK_, on 02 February 2012 - 08:31 AM, said:
Remove Access as the datasource, then use the wizard('Add Datasource') to find and add it.
I have problems now. I have a lot of binding sources, and if I remove datasource all my binding sources are gone. Then I must setup all my binding sources from beginning. Is there any better way to do it?because I am developing application and I don't know how my database tables will look like at the end. Every little bit i have to change tables construction ,and every little change is additional work
#7
Re: OleDb DataGridView binding problem
Posted 06 February 2012 - 05:03 PM
OK, you should have 2 databases depending on how you set this up. If you have the database listed in your solution explorer then it is a local database. This means that a copy is created inside your bin\debug folder. Check to ensure that both of these have the new table, if not, the easiest thing to do would be to just copy the newer database over top of the older-outdated one.
Then try and re-run.
If you have not created a local database, make sure you changed the correct one; check the path in your connection string to ensure that you are working with that actual database.
Then try and re-run.
If you have not created a local database, make sure you changed the correct one; check the path in your connection string to ensure that you are working with that actual database.
#8
Re: OleDb DataGridView binding problem
Posted 06 February 2012 - 05:17 PM
I'am 100% sure ,I am working with right database. When I add new field to database table,i always do copy database to both folders. Problem is, new fields doesn't apply in datagridview. I must remove all (datasource ,dataset ,databinding sources) and for each datagridview and data combos add new binding source. Only then I can see new fields in datagrid.
#9
Re: OleDb DataGridView binding problem
Posted 06 February 2012 - 06:03 PM
OK, if you added the new table to the database that is created in your bin/debug folder you will need to copy that back to the solution folder as that is where vs gets it's information for the database you have inside the IDE. If you do this and then re-connect to your database, you should see that new table in your server explorer.
#10
Re: OleDb DataGridView binding problem
Posted 06 February 2012 - 06:22 PM
CharlieMay, on 06 February 2012 - 06:03 PM, said:
OK, if you added the new table to the database that is created in your bin/debug folder you will need to copy that back to the solution folder as that is where vs gets it's information for the database you have inside the IDE. If you do this and then re-connect to your database, you should see that new table in your server explorer.
I have problems when I add new fields to table. For example: I have datagrid. Then I go to datagrid properties and select datasource. After that new dataset is created, then I pick table from new dataset. Then , after some time I want to add new fields to database table. After that new fields doesn't show up in datagrid. I always make sure that both databases are the same (from debug and solution folder).
#12
Re: OleDb DataGridView binding problem
Posted 06 February 2012 - 06:58 PM
It's problem whit access. I can't modify database or add new fields in VS like in this tutorial. When I right click on table there is no 'open table definition' option.
If I click 'retrieve data' i can see all records from table, even the new fields. But I can't apply those new fields(columns) to datagridview.
If I click 'retrieve data' i can see all records from table, even the new fields. But I can't apply those new fields(columns) to datagridview.
#13
Re: OleDb DataGridView binding problem
Posted 06 February 2012 - 08:09 PM
Switch to SQLServer. You can update your tables right in the designer.
#14
Re: OleDb DataGridView binding problem
Posted 07 February 2012 - 04:20 AM
_HAWK_, on 06 February 2012 - 08:09 PM, said:
Switch to SQLServer. You can update your tables right in the designer.
One question. Right now I'am downloading sql server 2008 express r2 something, it has 58 MB. I am wondering if I install my application with sql database on some other computer, does this computer also need to install sql server, in order to my application works properly.? If it's so, than I don't know is it worth it to switch to sql. With access that's newer been a problem. Thanks.
#15
Re: OleDb DataGridView binding problem
Posted 07 February 2012 - 05:41 PM
No there is a database engine for that, I'll see if I can find a link.
|
|

New Topic/Question
Reply



MultiQuote





|