Results 1 to 11 of 11

Thread: Resolved! Datagrid error "No value given

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    North East America
    Posts
    463

    Resolved! Datagrid error "No value given

    My datagrid will not populate. I continue to get this error:

    System.Data.OleDb.OleDbException was unhandled by user code
    ErrorCode=-2147217904
    Message="No value given for one or more required parameters."
    Source="Microsoft JET Database Engine"


    Here is my code, if someone could look at it and tell me where I am going wrong that would be great.

    VB Code:
    1. <%@ Import Namespace="System.Data.OleDB" %>
    2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    3. <html>
    4. <head>
    5. <title>B-Series</title>
    6. <script runat="server" language="VB">
    7.     Dim objConn As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\Documents and Settings\TMACPHERSON\My Documents\Visual Studio 2005\Projects\CodFish\BrocadeFirmwareStatus.mdb")
    8.     Dim objCmd As System.Data.OleDb.OleDbCommand
    9.     Dim objRdr As System.Data.OleDb.OleDbDataReader
    10. Dim strCmd As String
    11.  
    12.     Sub Page_Load()
    13.         If Not IsPostBack Then
    14.             'MsgBox("yes")
    15.             BindData()
    16.            
    17.         End If
    18.     End Sub
    19.  
    20.     Sub BindData()
    21.         objConn.Open()
    22.         objCmd = New OleDbCommand("SELECT HP_Model, Brocade_Model, FW, Minimum, Recommended, Next_Planned_Release, Notes FROM status ORDER BY FW, HP_Model", objConn)
    23.         [b]'ERRORS HERE [color=red]objRdr = objCmd.ExecuteReader()[/color][/b][color=red][/color]
    24.         BseriesGrid.DataSource = objRdr
    25.         BseriesGrid.DataBind()
    26.         objRdr.Close()
    27.         objConn.Close()
    28.     End Sub
    29. </script>
    30. </head>
    31.  
    32. <body>
    33.  
    34.  
    35. <form id="Form1" runat="server">
    36.   <table align="center" border="0" width="100%">
    37.        <tr>
    38.                    <td align="center" style="height: 541px">
    39.                  <h1>Firmware Matrix</h1>                                                                                            
    40.  <asp:DataGrid ID="BseriesGrid" runat="server" Caption="B-Series" AutoGenerateColumns="false" BorderColor="red"  BorderStyle="solid" BorderWidth="2" AllowPaging="true" DataKeyField="FW">
    41.  <Columns>
    42. <asp:BoundColumn DataField="HP_Model" HeaderText="HP_Model" />
    43. <asp:BoundColumn DataField="Brocade_Model" HeaderText="Brocade_Model" />
    44.   <asp:BoundColumn DataField="FW" HeaderText="FW" />
    45.       <asp:BoundColumn DataField="Minimum" HeaderText="Minimum" />
    46. <asp:BoundColumn DataField="Recommended" HeaderText="Recommended" />
    47. <asp:BoundColumn DataField="Next_Planned_Release" HeaderText="Next_Planned_Release" />
    48. <asp:BoundColumn DataField="Notes" HeaderText="Notes" />
    49.  </Columns>
    50.    </asp:DataGrid>
    51.                                                                                    
    52.   </td>
    53.          </tr>
    54.       </table>
    55.   </form>
    56.                                                                            
    57.                                                                      
    58.                                                    
    59. </body>
    60.  
    61. </html>
    Last edited by Troy Mac; Aug 30th, 2006 at 03:06 PM. Reason: Resovled
    TMacPherson
    MIS Systems Engineer
    [email protected]


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width