Need Help. filtering a SQLDataAdapter with a girdview selected.value [modified]
-
i have a grid view with bind to a sqlDatasource and I have a repeater that i want populate, according with the selected item in the grid view. and the data comes from a relational tables. here is the grid view and and the sqldataadapter, I know i am doing something wrong, but i dont know what it is, help please
asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="EventId" DataSourceID="SqlDataSource1" SelectedIndex="1">
and here is the the sqldataadpterSub BindData() 'Read sample item info from XML document into a DataSet Dim cnn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("vpx_newConnectionString").ToString) cnn.Open() Dim cmd As SqlDataAdapter = New SqlDataAdapter("select * from mediaphotos Where EventID =" & GridView1.SelectedValue, cnn) Dim ds As New DataSet() cmd.Fill(ds)
-- modified at 10:13 Monday 17th September, 2007 -
i have a grid view with bind to a sqlDatasource and I have a repeater that i want populate, according with the selected item in the grid view. and the data comes from a relational tables. here is the grid view and and the sqldataadapter, I know i am doing something wrong, but i dont know what it is, help please
asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="EventId" DataSourceID="SqlDataSource1" SelectedIndex="1">
and here is the the sqldataadpterSub BindData() 'Read sample item info from XML document into a DataSet Dim cnn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("vpx_newConnectionString").ToString) cnn.Open() Dim cmd As SqlDataAdapter = New SqlDataAdapter("select * from mediaphotos Where EventID =" & GridView1.SelectedValue, cnn) Dim ds As New DataSet() cmd.Fill(ds)
-- modified at 10:13 Monday 17th September, 2007 -
I think u want to filter your data in GridView. so for that u have to use DataView concept . u can use dataview.filter=Expression. MBMB