|
Okay, So I've added a view to my DataBase. NOthing big, probably happens all the time. So to reflect this, I go into the Server Explorer, Select my Database connection, and refresh it until the View becomes visible. I then proceed to drag the view onto the dataset designer, which still contains all my other tables, views, and relations, and it generates the datatable and table adapter. I save it. NOw for some idiotic reason, the Table Adapter Manager does not defaultly create an Editor Browsable Table adapter property for any Views, only tables. Even more moronic is when I add the properties and private fields manually in the Extended "partial class" and even try putting the attributes Browsable(True) and/or EditorBrowsable(True) the adapter manager properties for the TableAdapters for Views are still not visible in the forms designer. As foolish and ill-foresighted as this may be I can deal. But now, after simply adding a View to the dataset, I go into to my bindingsource, select Datasource = MyDataSet, and lo and behold under the DataMember the new view is NOT visible. Now, previously, I added a secondary relation to this dataset, that basically linked a table to a view, so that I could get all of the "child" rows based upon the selected "parent" row, even though the child was a View not a table. When the Designer failed to recognize this as a valid DataMember, I thought, perhaps it has to do with some random affect of it being a software (dataset) relation as opposed to a Database relation. But now, the qry_ServiceDates exists in the database, and in the DataSet, and the DataMember editor will not let me select it. I manually type it and I get the Invalid Property Error. So. How do I fix this other than Re-writing the DataSetGenerator myself. (I was hoping to avoid this, but it is one thing when I want it to do something above and beyond the initial design, but it is an entirely different thing when the packaged systems don't even work the way they are supposed to.) Thanks Jaeden "Sifo Dyas" al'Raec Ruiner "Never Trust a computer. Your brain is smarter than any micro-chip." | | JaedenRuiner Friday, July 24, 2009 6:37 PM | Hi Jaeden,
RE: the Table Adapter Manager does not defaultly create an Editor Browsable Table adapter property for any Views, only tables. Answer: Are you saying the TableAdapterManager does not contains any property for view's tableAdapter?If so, this is by design as TableAdapterManager is used for managing the update commands. Because the view does not have update command, it will not be included in the TableAdapterManager.
RE: after simply adding a View to the dataset, I go into to my bindingsource, select Datasource = MyDataSet, and lo and behold under the DataMember the new view is NOT visible. I can't repro this and i think your next issue is related to this.
I would suggest you start a new project and go throuth this simple repro steps and see it can repro or not: I assume you are using the DataSource tools to setup your form like this: Start VS, Add a dataset Add a table and view (from a well known sample database, e.g. Northwind). In form, drag drop a table from datasoruce window to the form (this will create a bindingsource), or drag drop a BindingSoruce control fromToolBox to the form.
Now select the bindingsoure and set its datasource to the dataset. And finally check the datamember.
John - Marked As Answer byKira QianMSFT, ModeratorFriday, July 31, 2009 6:08 AM
-
| | John Chen MS Sunday, July 26, 2009 8:02 AM | The actual issue: VS caches assemblies. C:\Documents And Settings\[Profile]\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemblies Delete All items in that directory and restart VS. Once rebooted, update the build number of the project and re-build. then it finds and notices the added properties I extended the Dataset and TableAdapterManager with in the designer. As for the TableAdapterManager, I sort of already guessed why it didn't add the views to the list of adapters, I just disagree. Sure a 'view' isn't updated like a table is, but when I create methods like "FillEntireDataset" it would be helpful for all my views, tables and every thing to be readily available. I like having the single entry point via the TAM to manage my datasets, and that includes filling as well as updating. Use the updating functions won't operate on the Views, but the Fill(dataset) function should. As it is, Every time I create a Dataset for a Project, I have to add all my non-table assets manually to the extended TableAdapterManager so I can Manage the Tables of the dataset. If it is so limited as to only handle updating then it should be called: TableAdapterUpdater, because a Manager "Manages", an Updater only Updates. Sorry for the semantics, but they can be very helpful and quite important. (And to think FxCop complains about my naming conventions when mine actually describe what things do). Jaeden "Sifo Dyas" al'Raec Ruiner
"Never Trust a computer. Your brain is smarter than any micro-chip."- Marked As Answer byJaedenRuiner Monday, August 17, 2009 4:49 PM
-
| | JaedenRuiner Monday, August 17, 2009 4:49 PM | Hi Jaeden,
RE: the Table Adapter Manager does not defaultly create an Editor Browsable Table adapter property for any Views, only tables. Answer: Are you saying the TableAdapterManager does not contains any property for view's tableAdapter?If so, this is by design as TableAdapterManager is used for managing the update commands. Because the view does not have update command, it will not be included in the TableAdapterManager.
RE: after simply adding a View to the dataset, I go into to my bindingsource, select Datasource = MyDataSet, and lo and behold under the DataMember the new view is NOT visible. I can't repro this and i think your next issue is related to this.
I would suggest you start a new project and go throuth this simple repro steps and see it can repro or not: I assume you are using the DataSource tools to setup your form like this: Start VS, Add a dataset Add a table and view (from a well known sample database, e.g. Northwind). In form, drag drop a table from datasoruce window to the form (this will create a bindingsource), or drag drop a BindingSoruce control fromToolBox to the form.
Now select the bindingsoure and set its datasource to the dataset. And finally check the datamember.
John - Marked As Answer byKira QianMSFT, ModeratorFriday, July 31, 2009 6:08 AM
-
| | John Chen MS Sunday, July 26, 2009 8:02 AM | The actual issue: VS caches assemblies. C:\Documents And Settings\[Profile]\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemblies Delete All items in that directory and restart VS. Once rebooted, update the build number of the project and re-build. then it finds and notices the added properties I extended the Dataset and TableAdapterManager with in the designer. As for the TableAdapterManager, I sort of already guessed why it didn't add the views to the list of adapters, I just disagree. Sure a 'view' isn't updated like a table is, but when I create methods like "FillEntireDataset" it would be helpful for all my views, tables and every thing to be readily available. I like having the single entry point via the TAM to manage my datasets, and that includes filling as well as updating. Use the updating functions won't operate on the Views, but the Fill(dataset) function should. As it is, Every time I create a Dataset for a Project, I have to add all my non-table assets manually to the extended TableAdapterManager so I can Manage the Tables of the dataset. If it is so limited as to only handle updating then it should be called: TableAdapterUpdater, because a Manager "Manages", an Updater only Updates. Sorry for the semantics, but they can be very helpful and quite important. (And to think FxCop complains about my naming conventions when mine actually describe what things do). Jaeden "Sifo Dyas" al'Raec Ruiner
"Never Trust a computer. Your brain is smarter than any micro-chip."- Marked As Answer byJaedenRuiner Monday, August 17, 2009 4:49 PM
-
| | JaedenRuiner Monday, August 17, 2009 4:49 PM |
|