Hello i am working now to design a new website my problem is that i cannot insert in to my DB i use access as my Data Base when i click the update tool in the grid view an error msg appears

'No value given for one or more required parameters.'

my variable can be null in the DB

please help me :sad:

Recommended Answers

All 2 Replies

Show us some of your efforts or code you have done so far...So that here experts can take a look and give you solution..

Hello i am working now to design a new website my problem is that i cannot insert in to my DB i use access as my Data Base when i click the update tool in the grid view an error msg appears

'No value given for one or more required parameters.'

my variable can be null in the DB

please help me :sad:

hello .....

this is my code...

<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="app+.aspx.vb" Inherits="app_" title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">

a:link
    {color:blue;
    text-decoration:underline;
    text-underline:single;}
    </style>
</asp:Content>
<asp:Content ID="Content2" runat="server" 
    contentplaceholderid="ContentPlaceHolder2">

                        <table class="style1">
                            <tr>
                                <td>
                                    <asp:DropDownList ID="DropDownList2" runat="server" 
                                        DataSourceID="AccessDataSource3" DataTextField="DEP" DataValueField="DEP">
                                    </asp:DropDownList>
                                    <asp:AccessDataSource ID="AccessDataSource3" runat="server" 
                                        DataFile="~/زيارات 2010.MDB" 
                                        SelectCommand="SELECT DISTINCT [DEP] FROM [data0004]">
                                    </asp:AccessDataSource>
                                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                                        AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" 
                                        BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="ID" 
                                        DataSourceID="AccessDataSource2">
                                        <RowStyle ForeColor="#000066" />
                                        <Columns>
                                            <asp:CommandField ShowEditButton="True" />
                                            <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" 
                                                SortExpression="ID" />
                                            <asp:BoundField DataField="APP_DATE" HeaderText="APP_DATE" 
                                                SortExpression="APP_DATE" />
                                            <asp:BoundField DataField="FACULTYNAM" HeaderText="FACULTYNAM" 
                                                SortExpression="FACULTYNAM" />
                                            <asp:BoundField DataField="FTEL" HeaderText="FTEL" SortExpression="FTEL" />
                                            <asp:BoundField DataField="FMOBILE" HeaderText="FMOBILE" 
                                                SortExpression="FMOBILE" />
                                            <asp:BoundField DataField="STATUS" HeaderText="STATUS" 
                                                SortExpression="STATUS" />
                                        </Columns>
                                        <FooterStyle BackColor="White" ForeColor="#000066" />
                                        <PagerTemplate>
                                            <br />
                                            <br />
                                            <br />
                                            <br />
                                        </PagerTemplate>
                                        <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                        <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                                    </asp:GridView>
                                    <asp:AccessDataSource ID="AccessDataSource2" runat="server" 
                                        DataFile="~/زيارات 2010.MDB" 
                                        DeleteCommand="DELETE FROM [data0004] WHERE (([ID] = ?) OR ([ID] IS NULL AND ? IS NULL))" 
                                        InsertCommand="INSERT INTO [data0004] ([ID], [APP_DATE], [FACULTYNAM], [FTEL], [FMOBILE], [STATUS]) VALUES (?, ?, ?, ?, ?, ?)" 
                                        OldValuesParameterFormatString="original_{0}" 
                                        SelectCommand="SELECT [ID], [APP_DATE], [FACULTYNAM], [FTEL], [FMOBILE], [STATUS] FROM [data0004] WHERE ([DEP] = ?)" 
                                        UpdateCommand="UPDATE [data0004] SET [APP_DATE] = ?, [FACULTYNAM] = ?, [FTEL] = ?, [FMOBILE] = ?, [STATUS] = ? WHERE (([ID] = ?) OR ([ID] IS NULL AND ? IS NULL))">
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="DropDownList2" Name="DEP" 
                                                PropertyName="SelectedValue" Type="String" />
                                        </SelectParameters>
                                        <DeleteParameters>
                                            <asp:Parameter Name="original_ID" Type="Double" />
                                        </DeleteParameters>
                                        <UpdateParameters>
                                            <asp:Parameter Name="APP_DATE" Type="DateTime" />
                                            <asp:Parameter Name="FACULTYNAM" Type="String" />
                                            <asp:Parameter Name="FTEL" Type="Double" />
                                            <asp:Parameter Name="FMOBILE" Type="Double" />
                                            <asp:Parameter Name="STATUS" Type="String" />
                                            <asp:Parameter Name="original_ID" Type="Double" />
                                        </UpdateParameters>
                                        <InsertParameters>
                                            <asp:Parameter Name="ID" Type="Double" />
                                            <asp:Parameter Name="APP_DATE" Type="DateTime" />
                                            <asp:Parameter Name="FACULTYNAM" Type="String" />
                                            <asp:Parameter Name="FTEL" Type="Double" />
                                            <asp:Parameter Name="FMOBILE" Type="Double" />
                                            <asp:Parameter Name="STATUS" Type="String" />
                                        </InsertParameters>
                                    </asp:AccessDataSource>
                                    <br />
                                    <br />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <br />
                                    <asp:Button ID="Button1" runat="server" Text="Button" />
                                    <br />
                                </td>
                            </tr>
    </table>

</asp:Content>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.