asp.net - Getting SQLDataSource Update Parameter from Gridview -


I am trying to get a parameter from my gridview to update but it is an ID column that I Do not want to display If I display the data in the boundfield then it works fine, but if I set the visibility to false, then the parameter update will not be sent to the stored process. Does not appear in the form of a hidden column that I can put in the gridview.

I have tried to set the parameters through the code behind, but I do not know how the code I can access the following data does not work (this parameter does not set anything GVFacilityDisciplineBillingRate.RowUpdating GridViewRow = GrvFacilityDisciplineBillingRate.Rows (E.RowIndex) sqlDisciplineBillingRate.UpdateParameters ("Convenient_ID")

  Protects sub-grvFacilityDisciplineBillingRate_RowUpdating (ByVal Sender as ByVal E, GridViewUpdateEventArgs as Object) "). DefaultValue = CInt (row.DataItem (" Facility_ID ")) sqlDisciplin EBillingRate.UpdateParameters ("Discipline_ID"). DefaultValue = CInt (row.DataItem ("Discipline_ID")) End Sub   

And it has been shown that there is a front end with two ID columns, which Is not what I want

  & lt; ASP: select SQLDataSource id = "sqlDisciplineBillingRate" runat = "server" datasource = "dataset" type the command type = "stored processor" SelectCommand = " SP_Facility_DisciplineBillingRates "UpdateCommandType =" StoredProcedure "UpdateCommand =" SP_DiscplineBillingRate_Update "ConnectionString =" & $; ConnectionStrings: Trustaff_ESig2% & gt; "& Gt; SelectParameters & gt; & lt; asp: parameter name =" feature_id "dbtv =" int 32 "/> & lt; / selectpurameters & gt; & lt; updateparameters & gt; & lt ; Asp: parameter name = "feature_id" dbtv = "int 32" /> asp: parameter name = "discipline_ID" dbType = "int32" />  & lt ; / ASP: SQLDataSource & gt; ASP: GridView ID = "Gref Defincibility Root" = "Server" Datasource ID = "SQLDispublishingRate" DataName = "Descript Billing RATID" Autoconnect Allow column = "false" permission = "false" autoconfiguration = "false" autosuggestedAdit button = "true" csslace = "gridview" & gt; EmptyDataTemplate & gt; There was no discipline billing rate for this feature. Lt; / EmptyDataTemplate & gt; & lt; Column & gt; & lt; ASP: BoundfieldDefined = "Name" HeaderTax = "Discipline" sortExpress = "name" read only = "true" /> & lt; ASP: Boundfield Dated Field = "BillingRate" Header Text = "Billing Rate" Sorted Expression = "Bill Ngret "/ & gt; & Lt; ASP: BoundField DataField = "Facility_ID" HeaderText = "Facility_ID" SortExpression = "Convenience_ID" InsertVisible = "false" /> & Lt; ASP: Boundfield datedfield = "discipline_id" header text = "discipline_id" ordering = "discipline_id" /> & Lt; / Column & gt; & Lt; / ASP: GridView & gt;    

You have to set the bus e.g. DataKeyNames = "Facilitate_ID, Discipline_ID" and SQLDataSource should have figured out for you when using GV updates and removing the feature.

Comments