Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > กดปุ่ม update ข้อมูลไม่ได้ Error "No value given for one or more required parameters" (ASP.NET)



 

กดปุ่ม update ข้อมูลไม่ได้ Error "No value given for one or more required parameters" (ASP.NET)

 



Topic : 080694



โพสกระทู้ ( 98 )
บทความ ( 0 )



สถานะออฟไลน์




กดปุ่ม update ข้อมูลไม่ได้ Error "No value given for one or more required parameters" DataBase มี ค่าดังนี้
1.ID ส่งค่าเป็น Number
2.REF ส่งค่าเป็น text
3.EAN ส่งค่าเป็น text

ช่วยที่ครับ หัดเขียนพื้นฐาน แก้ไม่ถูก



Tag : ASP.NET Ms Access, Web (ASP.NET), Windows







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-07-07 01:47:48 By : mrcool_307 View : 1169 Reply : 2
 

 

No. 1



โพสกระทู้ ( 98 )
บทความ ( 0 )



สถานะออฟไลน์


ผมตัวช่วยสร้างของ ASP.NET ไม่ได้เขียนโค๊ดเอง

Code (VB.NET)
<head>
    <style type="text/css">
        .style1
        {
            width: 102px;
        }
        .style2
        {
            width: 122px;
        }
    </style>
</head>
<form id="form1" runat="server">
<asp:AccessDataSource ID="AccessDataSource2" runat="server" 
    ConflictDetection="CompareAllValues" DataFile="~/App_Data/Database2.mdb" 
    DeleteCommand="DELETE FROM [Table1] WHERE (([ID] = ?) OR ([ID] IS NULL AND ? IS NULL)) AND (([ref] = ?) OR ([ref] IS NULL AND ? IS NULL)) AND (([ean] = ?) OR ([ean] IS NULL AND ? IS NULL))" 
    InsertCommand="INSERT INTO [Table1] ([ID], [ref], [ean]) VALUES (?, ?, ?)" 
    OldValuesParameterFormatString="original_{0}" 
    SelectCommand="SELECT * FROM [Table1]" 
    
    UpdateCommand="UPDATE [Table1] SET [ref] = ?, [ean] = ? WHERE (([ID] = ?) OR ([ID] IS NULL AND ? IS NULL)) AND (([ref] = ?) OR ([ref] IS NULL AND ? IS NULL)) AND (([ean] = ?) OR ([ean] IS NULL AND ? IS NULL))">
    <DeleteParameters>
        <asp:Parameter Name="original_ID" Type="String" />
        <asp:Parameter Name="original_ref" Type="String" />
        <asp:Parameter Name="original_ean" Type="String" />
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter Name="ref" Type="String" />
        <asp:Parameter Name="ean" Type="String" />
        <asp:Parameter Name="original_ID" Type="String" />
        <asp:Parameter Name="original_ref" Type="String" />
        <asp:Parameter Name="original_ean" Type="String" />
    </UpdateParameters>
    <InsertParameters>
        <asp:Parameter Name="ID" Type="String" />
        <asp:Parameter Name="ref" Type="String" />
        <asp:Parameter Name="ean" Type="String" />
    </InsertParameters>
</asp:AccessDataSource>
<asp:FormView ID="FormView1" runat="server" BackColor="LightGoldenrodYellow" 
    BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataKeyNames="ID" 
    DataSourceID="AccessDataSource2" ForeColor="Black">
    <FooterStyle BackColor="Tan" />
    <EditItemTemplate>
        <table style="width: 88%;">
            <tr>
                <td class="style1">
                    แก้ไข</td>
                <td class="style2">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style1">
                    รหัสสินค้า</td>
                <td class="style2">
                    <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
                </td>
                <td>
                    <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                        CommandName="Update" Text="Update" />
                </td>
            </tr>
            <tr>
                <td class="style1">
                    ชื่อสินค้า</td>
                <td class="style2">
                    <asp:TextBox ID="refTextBox" runat="server" Text='<%# Bind("ref") %>' />
                </td>
                <td class="style1">
                    <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" 
                        CommandName="Cancel" Text="Cancel" />
                </td>
            </tr>
            <tr>
                <td class="style1">
                    บาร์โค๊ด</td>
                <td class="style2">
                    <asp:TextBox ID="eanTextBox" runat="server" Text='<%# Bind("ean") %>' />
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    </EditItemTemplate>
    <InsertItemTemplate>
        ID:
        <asp:TextBox ID="IDTextBox" runat="server" Text='<%# Bind("ID") %>' />
        <br />
        ref:
        <asp:TextBox ID="refTextBox" runat="server" Text='<%# Bind("ref") %>' />
        <br />
        ean:
        <asp:TextBox ID="eanTextBox" runat="server" Text='<%# Bind("ean") %>' />
        <br />
        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
            CommandName="Insert" Text="Insert" />
        &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
    </InsertItemTemplate>
    <ItemTemplate>
        <br />
        &nbsp;&nbsp;<table style="width: 88%;">
            <tr>
                <td class="style1">
                    ทะเบียนสินค้า</td>
                <td class="style2">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style1">
                    รหัสสินค้า</td>
                <td class="style2">
                    <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                </td>
                <td>
                    <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                        CommandName="New" Text="เพิ่มข้อมูลสินค้า" />
                    <asp:Button ID="Button1" runat="server" CausesValidation="False" 
                        CommandName="new" Text="Button" />
                </td>
            </tr>
            <tr>
                <td class="style1">
                    ชื่อสินค้า</td>
                <td class="style2">
                    <asp:Label ID="refLabel" runat="server" Text='<%# Bind("ref") %>' />
                </td>
                <td>
                    <asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                        CommandName="Delete" Text="ลบข้อมูลสินค้า" />
                </td>
            </tr>
            <tr>
                <td class="style1">
                    บาร์โค๊ด</td>
                <td class="style2">
                    <asp:Label ID="eanLabel" runat="server" Text='<%# Bind("ean") %>' />
                </td>
                <td>
                    <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                        CommandName="Edit" Text="แก้ไขข้อมูลสินค้า" />
                </td>
            </tr>
        </table>
        <br />
        <br />
        
    </ItemTemplate>
    <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
        HorizontalAlign="Center" />
    <HeaderStyle BackColor="Tan" Font-Bold="True" />
    <EditRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
</asp:FormView>
<br />
</form>







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-07-07 01:49:37 By : mrcool_307
 


 

No. 2



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

เหมือนกับว่า DataType ผิดหรือเปล่าครับ

No value given for one or more require parameters

สอบถามปัญหาการ update ข้อมูลครับ เกิด error ตรง dtAdapter.Fill(dt) รายละเอียดด้านในเลยครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-07-08 07:30:54 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : กดปุ่ม update ข้อมูลไม่ได้ Error "No value given for one or more required parameters" (ASP.NET)
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่