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:
<%@ Import Namespace="System.Data.OleDB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>B-Series</title> <script runat="server" language="VB"> 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") Dim objCmd As System.Data.OleDb.OleDbCommand Dim objRdr As System.Data.OleDb.OleDbDataReader Dim strCmd As String Sub Page_Load() If Not IsPostBack Then 'MsgBox("yes") BindData() End If End Sub Sub BindData() objConn.Open() objCmd = New OleDbCommand("SELECT HP_Model, Brocade_Model, FW, Minimum, Recommended, Next_Planned_Release, Notes FROM status ORDER BY FW, HP_Model", objConn) [b]'ERRORS HERE [color=red]objRdr = objCmd.ExecuteReader()[/color][/b][color=red][/color] BseriesGrid.DataSource = objRdr BseriesGrid.DataBind() objRdr.Close() objConn.Close() End Sub </script> </head> <body> <form id="Form1" runat="server"> <table align="center" border="0" width="100%"> <tr> <td align="center" style="height: 541px"> <h1>Firmware Matrix</h1> <asp:DataGrid ID="BseriesGrid" runat="server" Caption="B-Series" AutoGenerateColumns="false" BorderColor="red" BorderStyle="solid" BorderWidth="2" AllowPaging="true" DataKeyField="FW"> <Columns> <asp:BoundColumn DataField="HP_Model" HeaderText="HP_Model" /> <asp:BoundColumn DataField="Brocade_Model" HeaderText="Brocade_Model" /> <asp:BoundColumn DataField="FW" HeaderText="FW" /> <asp:BoundColumn DataField="Minimum" HeaderText="Minimum" /> <asp:BoundColumn DataField="Recommended" HeaderText="Recommended" /> <asp:BoundColumn DataField="Next_Planned_Release" HeaderText="Next_Planned_Release" /> <asp:BoundColumn DataField="Notes" HeaderText="Notes" /> </Columns> </asp:DataGrid> </td> </tr> </table> </form> </body> </html>




Reply With Quote