OleDb DataGridView binding problem

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 561 Views - Last Post: 07 February 2012 - 06:04 PM Rate Topic: -----

Topic Sponsor:

#1 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 67
  • View blog
  • Posts: 522
  • Joined: 21-December 11

OleDb DataGridView binding problem

Posted 02 February 2012 - 07:49 AM

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.

Is This A Good Question/Topic? 0
  • +

Replies To: OleDb DataGridView binding problem

#2 _HAWK_  Icon User is online

  • Master(Of Foo)
  • member icon

Reputation: 756
  • View blog
  • Posts: 2,821
  • Joined: 02-July 08

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.
Was This Post Helpful? 1
  • +
  • -

#3 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 67
  • View blog
  • Posts: 522
  • Joined: 21-December 11

Re: OleDb DataGridView binding problem

Posted 02 February 2012 - 08:13 AM

View Post_HAWK_, on 02 February 2012 - 07:52 AM, said:

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.

You mean to remove dataset? or binding source?
Was This Post Helpful? 0
  • +
  • -

#4 _HAWK_  Icon User is online

  • Master(Of Foo)
  • member icon

Reputation: 756
  • View blog
  • Posts: 2,821
  • Joined: 02-July 08

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.
Was This Post Helpful? 0
  • +
  • -

#5 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 67
  • View blog
  • Posts: 522
  • Joined: 21-December 11

Re: OleDb DataGridView binding problem

Posted 02 February 2012 - 08:58 AM

THANKS
Was This Post Helpful? 0
  • +
  • -

#6 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 67
  • View blog
  • Posts: 522
  • Joined: 21-December 11

Re: OleDb DataGridView binding problem

Posted 06 February 2012 - 04:25 PM

View Post_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
Was This Post Helpful? 0
  • +
  • -

#7 CharlieMay  Icon User is online

  • This space intentionally left blank
  • member icon

Reputation: 960
  • View blog
  • Posts: 3,353
  • Joined: 25-September 09

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.
Was This Post Helpful? 0
  • +
  • -

#8 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 67
  • View blog
  • Posts: 522
  • Joined: 21-December 11

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.
Was This Post Helpful? 0
  • +
  • -

#9 CharlieMay  Icon User is online

  • This space intentionally left blank
  • member icon

Reputation: 960
  • View blog
  • Posts: 3,353
  • Joined: 25-September 09

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.
Was This Post Helpful? 0
  • +
  • -

#10 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 67
  • View blog
  • Posts: 522
  • Joined: 21-December 11

Re: OleDb DataGridView binding problem

Posted 06 February 2012 - 06:22 PM

View PostCharlieMay, 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).
Was This Post Helpful? 0
  • +
  • -

#11 CharlieMay  Icon User is online

  • This space intentionally left blank
  • member icon

Reputation: 960
  • View blog
  • Posts: 3,353
  • Joined: 25-September 09

Re: OleDb DataGridView binding problem

Posted 06 February 2012 - 06:33 PM

See if this helps
Was This Post Helpful? 0
  • +
  • -

#12 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 67
  • View blog
  • Posts: 522
  • Joined: 21-December 11

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.
Was This Post Helpful? 0
  • +
  • -

#13 _HAWK_  Icon User is online

  • Master(Of Foo)
  • member icon

Reputation: 756
  • View blog
  • Posts: 2,821
  • Joined: 02-July 08

Re: OleDb DataGridView binding problem

Posted 06 February 2012 - 08:09 PM

Switch to SQLServer. You can update your tables right in the designer.
Was This Post Helpful? 0
  • +
  • -

#14 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 67
  • View blog
  • Posts: 522
  • Joined: 21-December 11

Re: OleDb DataGridView binding problem

Posted 07 February 2012 - 04:20 AM

View Post_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.
Was This Post Helpful? 0
  • +
  • -

#15 _HAWK_  Icon User is online

  • Master(Of Foo)
  • member icon

Reputation: 756
  • View blog
  • Posts: 2,821
  • Joined: 02-July 08

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.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2