Ciao ragazzi.
Sto impazzendo perchè non riesco a risolvere l'errore al caricamento della pagina![]()
Il codice della mia pagina.aspx è il seguente:
Il codice della mia pagina.aspx.vb è il seguente:codice:<div class="middle"> <table style="width: 607px"> <tr> <td> <h1>Elenco dei gommoni disponibili in vendita</h1> </td> </tr> <tr> <td> In questo elenco sono visibili soltanto alcune delle caratteristiche dei gommoni. Per visualizzare i dettagli fare click su 'Seleziona' e poi sul pulsante 'Dettagli'. </td> </tr> </table> <asp:Panel ID="GommoniTutti" runat="server"> <table> <tr> <td style="width: 581px"> <asp:Label ID="messaggio" runat="server" Font-Italic="True" Font-Bold="True" Text="Numero gommoni trovati"/> <asp:Label ID="TotaleRisultati" runat="server" Font-Size="Smaller" ForeColor="#68a0f9"/> <asp:GridView ID="gvGommoniVend" runat="server" AutoGenerateColumns="False" CellPadding="4" DataSourceID="GommoniVendDS" Font-Names="Trebuchet MS" Font-Size="Small" ForeColor="#333333" GridLines="None" SelectedIndex="0" Width="580px"> <FooterStyle BackColor="#000099" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#E3EAEB" ForeColor="#000099" /> <EditRowStyle BackColor="#7C6F57" /> <SelectedRowStyle BackColor="#B1E3EC" Font-Bold="True" ForeColor="#000099" /> <PagerStyle BackColor="#B1E3EC" ForeColor="#000099" HorizontalAlign="Center" Font-Bold="True" /> <HeaderStyle Font-Bold="True" ForeColor="#000099" /> <AlternatingRowStyle BackColor="White" /> <Columns> <asp:CommandField SelectText="Seleziona" ShowSelectButton="True" /> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" /> <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" /> <asp:BoundField DataField="Stato" HeaderText="Stato" SortExpression="Stato" /> <asp:BoundField DataField="Prezzo" HeaderText="Prezzo" SortExpression="Prezzo" /> <asp:ButtonField ButtonType="Button" Text="Dettagli" CommandName="DettagliGommone"/> </Columns> </asp:GridView> <asp:SqlDataSource ID="GommoniVendDS" runat="server" ProviderName="System.Data.OleDb" SelectCommand='SELECT [ID], [Nome], [Stato], [Prezzo] FROM [Noleggio]'> </asp:SqlDataSource> </td> </tr> </table> </asp:Panel> <asp:Panel ID="dettagliGommone" runat="server"> <table> <tr> <td colspan="2"> <asp:Label cssClass="labelTitolo" ID="label11" Text="Dettagli del gommone selezionato" runat="server" /> < </td> </tr> <tr> <td style="height: 1%;"> <asp:Label ID="Label1" runat="server" Text="ID:" Font-Bold="True" /> </td> <td style="height: 1%"> <asp:TextBox CssClass="textBox" ID="txtID" ReadOnly="true" runat="server" /> </td> </tr> <tr> <td style="width: 125px"> <asp:Label ID="Label2" runat="server" Text="Nome:" Font-Bold="True" /> </td> <td> <asp:TextBox cssClass="textBox" ID="txtNome" runat="server" /> </td> </tr> <tr> <td style="width: 125px"> <asp:Label ID="Label3" runat="server" Text="Immagine:" Font-Bold="True" /> </td> <td> <asp:Image ID="Foto" runat="server" ToolTip="foto gommone"/> </td> </tr> <tr> <td style="width: 125px"> <asp:Label ID="Label4" runat="server" Text="Descrizione:" Width="102px" Font-Bold="True" /> </td> <td> <asp:TextBox CssClass="textBox" ID="txtDescrizione" runat="server" /> </td> </tr> <tr> <td style="width: 125px"> <asp:Label ID="Label5" runat="server" Text="Stato:" Font-Bold="True" /> </td> <td> <asp:TextBox CssClass="textBox" ID="txtStato" runat="server" /> </td> </tr> <tr> <td style="width: 125px; height: 1%;"> <asp:Label ID="Label6" runat="server" Text="Prezzo:" Width="96px" Font-Bold="True" /> </td> <td style="height: 1%"> <asp:TextBox CssClass="textBox" ID="txtPrezzo" runat="server" /> </td> </tr> <tr> <td style="width: 125px; height: 1%"> <asp:Label ID="Label7" runat="server" Text="Categoria:" Width="112px" Font-Bold="True" /> </td> <td style="height: 1%"> <asp:TextBox CssClass="textBox" ID="txtCategoria" runat="server" /> </td> </tr> <tr> <td style="width: 125px"> <asp:Label ID="nessunGommone" Text="Al momento non ci sono gommoni disponibili per la vendita" Visible="False" runat="server" ForeColor="Red" /> </td> </tr> <tr> <td colspan="2"> <asp:Button cssClass="styleButton" ID="Indietro" Text="Indietro" runat="server" Width="56px" ToolTip="indietro" /> </td> </tr> </table> </asp:Panel> </div>
L'errore che mi dà è la sottolineatura in verde della stringa " TotaleRisultati.Text = gvGommoniVend.Rows.Count.ToString + " utenti registrati trovati" " e la frase "Nessun valore specificato per alcuni parametri necessari."codice:Imports System.Data Imports System.Data.OleDb Partial Class Site_GommoniVendita Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load GommoniVendDS.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=" + Server.MapPath("..\db\dbNautica.mdb").ToString dettagliGommone.Visible = False TotaleRisultati.Text = gvGommoniVend.Rows.Count.ToString + " utenti registrati trovati" End Sub Protected Sub gvGommoniVend_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvGommoniVend.RowCommand If e.CommandName = "DettagliUtente" Then GommoniTutti.Visible = False dettagliGommone.Visible = True Dim row As GridViewRow row = gvGommoniVend.SelectedRow Dim sql As String sql = "SELECT ID, Nome, Immagine, Descrizione, Stato, Prezzo, Categoria FROM Noleggio WHERE ID =" + row.Cells(1).Text + ";" Dim connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=" + Server.MapPath("..\..\db\dbNautica.mdb").ToString Dim myconnection As New OleDbConnection(connectionstring) Dim mycommand As New OleDbCommand(sql, myconnection) myconnection.Open() Dim reader As OleDbDataReader reader = mycommand.ExecuteReader While reader.Read() txtID.Text = reader.Item(0).ToString txtNome.Text = reader.Item(1).ToString Foto.ImageUrl = reader.Item(2).ToString txtDescrizione.Text = reader.Item(3).ToString txtStato.Text = reader.Item(4).ToString txtPrezzo.Text = reader.Item(5).ToString txtCategoria.Text = reader.Item(6).ToString End While myconnection.Close() End If End Sub Protected Sub Indietro_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Indietro.Click GommoniTutti.Visible = True dettagliGommone.Visible = False End Sub End Class
mi sapete aiutare please????

Rispondi quotando