Hi,
I'm trying to something quite straightforward , populate a datagrid
with certain fields after selecting from a dropdownlist. The books I
have don't seem to give an example of how to do this ( particularly
from within VStudio 2003 ) and it's driving me to distraction.
daNumber1 selects the au_id and au_lname
SqlDataAdapter1 is attempting to take the parameter @au_id to populate
the datagrid1, but the SqlDataAdapter1 is giving the error "Class
'System.Data.Sq lClient.SqlData Adapter' cannot be indexed because it
has no default property." I don't understand what the default ought to
be...
As I say, I have no book examples to work from, so I'm just cobbling
together other bits in an attempt to understand/get it to work -
apologies if my poor code offends thee!
Thanks,
bob
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
SqlConnection1. Open()
daNumber1.Fill( dsNumber1)
If Not Page.IsPostBack Then
lstCategory.Dat aSource = dsNumber1()
lstCategory.Dat aValueField = "au_id"
lstCategory.Dat aTextField = "au_lname"
lstCategory.Dat aBind()
End If
End Sub
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e
As System.EventArg s) Handles Button1.Click
DataGrid1.DataS ource =
SqlDataAdapter1 (lstCategory.Se lectedValue)
DataGrid1.DataB ind()
End Sub