|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ADO.NET 2.0 TableAdapter Configuration WizardWhen I add a DataTable to a Typed Dataset, and a TableAdapter to the DataTable, I am able to create methods to send updates directly to the database (GenerateDBDirectMethods), however when my TableAdapter Fill SQL contains a WHERE clause which looks up a field from another joined table, the Fill works perfectly, but I cannot Insert, Update or Delete using the TableAdapter. Does anyone know why this is? I don't want to return ALL the data and then filter the results, I need to do this within the WHERE clause. I'm binding the DataTable to a DataGridView. Many thanks in advance! Mike As we've said many times, the TableAdapter gizmo is designed to work with
ONE table. Not the product of a JOIN. For that you're on your own to create the action commands. -- Show quoteHide quote____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ "Mike" <none> wrote in message news:OuSZC5bIGHA.524@TK2MSFTNGP09.phx.gbl... > Dear Group, > > When I add a DataTable to a Typed Dataset, and a TableAdapter to the > DataTable, I am able to create methods to send updates directly to the > database (GenerateDBDirectMethods), however when my TableAdapter Fill SQL > contains a WHERE clause which looks up a field from another joined table, > the Fill works perfectly, but I cannot Insert, Update or Delete using the > TableAdapter. > > Does anyone know why this is? > > I don't want to return ALL the data and then filter the results, I need to > do this within the WHERE clause. > > I'm binding the DataTable to a DataGridView. > > Many thanks in advance! > > Mike > "William (Bill) Vaughn" <billvaRemoveT***@nwlink.com> wrote in message Thanks William,news:uN85djcIGHA.344@TK2MSFTNGP11.phx.gbl... > As we've said many times, the TableAdapter gizmo is designed to work with > ONE table. Not the product of a JOIN. For that you're on your own to > create the action commands. To be fair; I did suspect it, but couldn't find any authoritative MSDN article to suggest that this was the case. Almost all MSDN articles just don't mention it. Regards, Mike Check out the article "New DataSet Features in Visual Studio 2005" at
http://msdn.microsoft.com/vbasic/default.aspx?pull=/library/en-us/dnvs05/html/newdtastvs05.asp Although a TableAdapter can have multiple Fill commands, there is only one set of update commands that are executed when the TableAdapter's Update method is called. These are generated automatically, based on the TableAdapter's main query. The query that is defined when the TableAdapter is first created is considered the main query for the TableAdapter. If any subsequently defined queries return a schema that is different that the main query's schema, the designer will warn you about it with a message box. Alternatively, if you modify the schema of the main query, Visual Studio will go and modify your other queries to match that schema. Show quoteHide quote "Mike" wrote: > Dear Group, > > When I add a DataTable to a Typed Dataset, and a TableAdapter to the > DataTable, I am able to create methods to send updates directly to the > database (GenerateDBDirectMethods), however when my TableAdapter Fill SQL > contains a WHERE clause which looks up a field from another joined table, > the Fill works perfectly, but I cannot Insert, Update or Delete using the > TableAdapter. > > Does anyone know why this is? > > I don't want to return ALL the data and then filter the results, I need to > do this within the WHERE clause. > > I'm binding the DataTable to a DataGridView. > > Many thanks in advance! > > Mike > > >
date/time fields
Conditional statements SystemIndexOutOfRangeException error CheckForIllegalCrossThreadCalls ? throw/handle exceptions while using backgroundworker Strange maximize behaviour Queue of Threads How to use a Generic's base type? timing accuracy of VB.Net deleting files greater than x days |
|||||||||||||||||||||||