locked
Riddle me this? No value given for one or more required parameters. RRS feed

  • Question

  • User356974890 posted

    If I run this on my localhost with either webmatrix or visual studio it works fine.

    As soon as I upload it to my server I get the following error:

    Server Error in '/' Application.


    No value given for one or more required parameters.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.OleDb.OleDbException: No value given for one or more required parameters.

    Source Error:

    Line 17: cmdSelectMedia = New OLEDBCommand(OLEDBstrMedia, conTechnieklokaal) 
    Line 18: 
    Line 19: dtrMedia = cmdSelectMedia.ExecuteReader() 
    Line 20: Line 21: dltMedia.DataSource = dtrMedia

    How can this be???

    I'm at a loss... Cry

    This is my code.

    Thx! For helping out!

    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Technieklokaal.nl - Media" Debug="true" %>
    <%@ import Namespace="System.Data" %>
    <%@ import Namespace="System.Data.OLEDB" %>

    <script runat="server">


    Sub Page_Load()


    Dim conTechnieklokaal As OLEDBConnection
    Dim connstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|Technieklokaal.mdb;"

    Dim cmdSelectMedia As OLEDBCommand
    Dim OLEDBstrMedia As String = "Select Embedcode, Titel, Datum  From Media  Where Weergeven=-1 Order By Datum DESC"

    Dim dtrMedia As OLEDBDataReader

    conTechnieklokaal = New OLEDBConnection (connstr)
    conTechnieklokaal.open()
    cmdSelectMedia = New OLEDBCommand(OLEDBstrMedia, conTechnieklokaal)

    dtrMedia = cmdSelectMedia.ExecuteReader()
        
    dltMedia.DataSource = dtrMedia
    dltMedia.DataBind()      

    dtrMedia.Close()

    conTechnieklokaal.Close()

    End sub

    </script>


    <asp:Content ContentPlaceHolderID="Titel" Runat="server">
    <font class="headertext">Media</font>  
    </asp:Content>

    <asp:Content ContentPlaceHolderID="Body" Runat="server">
        
        <table cellspacing="20">
                  <tr>
                   <td class="user">
                       <asp:DataList ID="dltMedia" runat="server" RepeatDirection="Horizontal" RepeatColumns="3" cellspacing="30">
                            <ItemTemplate>
                                <%#Container.DataItem("Embedcode")%>
                                <br/>
                                <%#Container.DataItem("Titel") %>  
                            </ItemTemplate>
                       </asp:DataList>
                    </td>
                  </tr>  
                </table>
    </asp:Content> 

    Friday, December 30, 2011 2:51 PM

Answers

  • User-821857111 posted

    Double check the field names in the online database. One of them doesn't appear to match what is in your offline version.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 30, 2011 3:31 PM

All replies

  • User-821857111 posted

    Double check the field names in the online database. One of them doesn't appear to match what is in your offline version.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 30, 2011 3:31 PM
  • User356974890 posted

    Damn! I feel sooo stupid now!!

    I indeed did edit something in my database, thing is... I totally FORGOT until you reminded me!

    Thx!!

    Friday, December 30, 2011 3:42 PM