|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Vbnet 2005 and databases + database bug ??I hope to find some information on this way, I used to develop databases in Access and want to try visual basic VB.net 2005 Could someone help me how to link 2 datagrid like in the first grid I want to show Customers and the second grid Customers Contacts from Customers. I also have another question, Debugging program seems not to work correctly, is this a bug of VS2005? When by debugging and I makes some changes in the data so then I save the changes, this changes will not be shown when I debug again If I try the Exe this will work correctly Strange!! Like I remark there are 2 databases copys one in the Bin/Debug and another in the main dir By debugging when I save the other database is upgraded By debugging when I load the database again then I see the data from the fist database Hope someone can help me with usefull information, Marc.
Show quote
Hide quote
On Fri, 17 Mar 2006 08:08:43 +0100, "Marc" <April@village.invalid> One of the things to know when working with local database files iswrote: >Hi, > >I hope to find some information on this way, >I used to develop databases in Access and want to try visual basic VB.net >2005 > >Could someone help me how to link 2 datagrid like in the first grid I want >to show Customers and the second grid Customers Contacts from Customers. > >I also have another question, >Debugging program seems not to work correctly, is this a bug of VS2005? >When by debugging and I makes some changes in the data so then I save the >changes, this changes will not be shown when I debug again >If I try the Exe this will work correctly > >Strange!! >Like I remark there are 2 databases copys one in the Bin/Debug and another >in the main dir > >By debugging when I save the other database is upgraded >By debugging when I load the database again then I see the data from the >fist database > > > >Hope someone can help me with usefull information, >Marc. > From MSDN: that they are treated as any other content files. For desktop projects, it means that by default, the database file will be copied to the output folder (aka bin) each time the project is built. 1. If you select local database file in the Solution Explorer window, you will see a property called ‘Copy to Output’ in the Properties window. By default it is set to ‘Copy Always’ which means that on each build, the data files in the project folder will be copied to the output folder overwriting the existing data files if any. You can set this property to Copy Never and then manually put a copy of the data file in the output folder. This way, on subsequent builds, the project system will leave the datafile in the output folder and not try to overwrite it with the one from the project. The downside is that you still have two copies so after you modify the database file using the app, if you want to work on those changes in the project, you need to copy it to the project manually and vise-versa. 2. You can leave the data file outside the project and create a connection to it in Database Explorer. When the IDE asks you to bring the file into the project, just say no. This way, both the design-time and the run-time will be using the same data file but the downside is that the path in the connection string will be hard coded and therefore it’ll be harder to share the project and deploy the app. Before deploying the app, just make sure to replace the full path in the settings with a relative path. Note: "Copy If Newer" seems a better option if not outside the project. Gene Hi Gene,
Many thanks for your answer. Best regards Marc. Show quoteHide quote "gene kelley" <o***@by.me> schreef in bericht news:0ovk12hu3qmdtkbfkeftbm9mrd1oj8fe2j@4ax.com... > On Fri, 17 Mar 2006 08:08:43 +0100, "Marc" <April@village.invalid> > wrote: > >>Hi, >> >>I hope to find some information on this way, >>I used to develop databases in Access and want to try visual basic VB.net >>2005 >> >>Could someone help me how to link 2 datagrid like in the first grid I want >>to show Customers and the second grid Customers Contacts from Customers. >> >>I also have another question, >>Debugging program seems not to work correctly, is this a bug of VS2005? >>When by debugging and I makes some changes in the data so then I save the >>changes, this changes will not be shown when I debug again >>If I try the Exe this will work correctly >> >>Strange!! >>Like I remark there are 2 databases copys one in the Bin/Debug and another >>in the main dir >> >>By debugging when I save the other database is upgraded >>By debugging when I load the database again then I see the data from the >>fist database >> >> >> >>Hope someone can help me with usefull information, >>Marc. >> > From MSDN: > One of the things to know when working with local database files is > that they are treated as any other content files. For desktop > projects, it means that by default, the database file will be copied > to the output folder (aka bin) each time the project is built. > > 1. If you select local database file in the Solution Explorer window, > you will see a property called 'Copy to Output' in the Properties > window. By default it is set to 'Copy Always' which means that on each > build, the data files in the project folder will be copied to the > output folder overwriting the existing data files if any. You can set > this property to Copy Never and then manually put a copy of the data > file in the output folder. This way, on subsequent builds, the project > system will leave the datafile in the output folder and not try to > overwrite it with the one from the project. The downside is that you > still have two copies so after you modify the database file using the > app, if you want to work on those changes in the project, you need to > copy it to the project manually and vise-versa. > > 2. You can leave the data file outside the project and create a > connection to it in Database Explorer. When the IDE asks you to bring > the file into the project, just say no. This way, both the design-time > and the run-time will be using the same data file but the downside is > that the path in the connection string will be hard coded and > therefore it'll be harder to share the project and deploy the app. > Before deploying the app, just make sure to replace the full path in > the settings with a relative path. > > Note: "Copy If Newer" seems a better option if not outside the > project. > > Gene > |
|||||||||||||||||||||||