|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Master Detail w Multiple Keysand the detail being either a DetailsView or a FormView. I've gotten this to work as long as the relationship between the two controls only relys on one key field ( the datasource has a 'where' clause with only one field in it). I need two keys from the GridView table to control what shows up in the detail control. I've set the GridView to use a table that has a two-field primary key (TAPENO and RECORDING), and both fields show up in the DataKeyNames property of the GridView. When I create the datasource for the FormView control, I set the 'where' clause to request two fields. The wizard generates two lines in the WHERE clause text box: SQL Expression: Value: [TAPENO] = @TAPENO GridView1.SelectedValue [RECORDING] = @RECORDING GridView1.SelectedValue When I run the application, the FormView control shows no contents when I select an item from the GridView (master) control. I know the FormView is showing up, there some HTML for it as a table, but no rows or fields. Like I said, I've been able to do this in a one-key-field scenario, but not in a two-key-field scenario. Any suggestions? Ben -- bf001removet***@abovetheline.biz Ben,
I'm having the same problem. I ran a SQL trace using SQL Server Profiler and found the problem. The select statement for the DetatilsView is wrong. In my case the first key is CatalogNumber=000001 and the second key is LotNumber=200533001. When I look at the trace the SQL statement looks like this: exec sp_executesql N'SELECT CatalogNumber, CatalogName, PONumber, Vendor, VendorLotNumber, VendorGrade, LotNumber, Quantity, UofM, DateReceived, Location, DateEntered, PreviouslyApprovedLot, CofAIncluded, Quantity2, UofM2 FROM LotData WHERE (CatalogNumber = @CatalogNumber) and LotNumber = @LotNumber', N'@CatalogNumber nvarchar(6),@LotNumber nvarchar(6)', @CatalogNumber = N'000001', @LotNumber = N'000001' As you can see, the LotNumber is set to the same value as the CatalogNumber. I haven't found the solution yet but I will continue to work on it. Tom Show quoteHide quote "BJF" wrote: > My goal is to have a master/detail setup with the master being a GridView, > and the detail being either a DetailsView or a FormView. I've gotten this > to work as long as the relationship between the two controls only relys on > one key field ( the datasource has a 'where' clause with only one field in > it). > > I need two keys from the GridView table to control what shows up in the > detail control. I've set the GridView to use a table that has a two-field > primary key (TAPENO and RECORDING), and both fields show up in the > DataKeyNames property of the GridView. When I create the datasource for the > FormView control, I set the 'where' clause to request two fields. The > wizard generates two lines in the WHERE clause text box: > SQL Expression: Value: > [TAPENO] = @TAPENO > GridView1.SelectedValue > [RECORDING] = @RECORDING GridView1.SelectedValue > > When I run the application, the FormView control shows no contents when I > select an item from the GridView (master) control. I know the FormView is > showing up, there some HTML for it as a table, but no rows or fields. > > Like I said, I've been able to do this in a one-key-field scenario, but not > in a two-key-field scenario. > > Any suggestions? > > Ben > > -- > bf001removet***@abovetheline.biz > > >
Understanding query strings
VS2005 Designer does NOT display asp:panels!! Why? Coding issue contenteditable Referencing controls in a template programmatically Control.Controls bug? Control's child controls missing at the run time. View State problem when multiple user work on the same page onload called only once Custom Buttons preserve password field over steps in wizard |
|||||||||||||||||||||||