Voglio poter selezionare tramite un listbox una riga di una tabella in Access, ma non so come... ho fatto qualcosa, ma non so se può servire....grazie
codice:<%@ Page Language="VB" Debug="true"%> <%@ Import NameSpace="System.Data"%> <%@ Import NameSpace="System.Data.OleDb"%> <script runat="server"> Sub Page_Load(Obj As Object, e As EventArgs) If Not Page.ispostback then dim connessione as new OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\percorso\data.mdb") dim comando as new OleDbDataAdapter ("SELECT colonna FROM tabella;", myConnection) dim ds as DataSet=new DataSet() comando.Fill(ds,"tabella") lbtabella.selectedindex= COSA METTO QUI??? End If DataBind() End Sub </script> <html> <body> <form runat="server"> <asp:listbox runat="server" id="lbtabella" width="150" autopostback="true" selectionmode="single"> </asp:listbox> <asp:label id="lblMessaggio" runat="server" text='<%# lbtabella.selecteditem.text %>'/> </form> </body> </html>


Rispondi quotando