I have and entity datasource and i would like to add a where parameter so as to filter information. I have a gridview with a list of items and on checking a checkbox and hitting edit button, it sends you to a different view where there is a detailsview that has entitydatasource as it's DS. Now the entity datasource i want to add a where parameter. this is what i have so far..
<asp:EntityDataSource ID="EntityDataSource2" runat="server" ConnectionString="name=sspEntities" DefaultContainerName="sspEntities"
EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True"
EntitySetName="Salary_Increase_Type" AutoGenerateWhereClause="True">
</asp:EntityDataSource>
Protected Sub ImageButton3_Click(sender As Object, e As ImageClickEventArgs) Handles ImageButton3.Click
For Each dr As GridViewRow In GridView1.Rows
If ((TryCast(dr.FindControl("checkbox1"), CheckBox)).Checked = True) Then
Dim id As Integer = GridView1.DataKeys(dr.RowIndex).Value
EntityDataSource2.WhereParameters.Clear()
EntityDataSource2.WhereParameters.Add(id, "id")
MultiView1.ActiveViewIndex = 1
DetailsView1.ChangeMode(DetailsViewMode.Edit)
End If
Next
End Sub