好的,我将用图像讨论我的问题,以便我们轻松解决。希望。
首先,下图显示了 PersonalInfo.aspx 下的 PersonalInfo gridview
二、下图是MobileINfo.aspx下的MobileInfo gridview
三、现在我们要编辑这个页面MobileInfo.aspx中的记录
第四,下图我认为一切正常,因为数据已经更新。但...
第五次也是最后一次,我回到 PersonalInfo.aspx 但它给了我这个...数据已被删除
这是我的 PersonalInfo.aspx 代码
<asp:AccessDataSource runat="server" ID="AccessDataSource1" DeleteCommand="DELETE FROM [DriversRecords] WHERE [ID] = ?" InsertCommand="INSERT INTO [DriversRecords] ([Username], [Password], [FirstName], [LastName], [MiddleName], [Address], [Age], [Gender], [ContactNumber], [PlateNumber], [Color], [Brand], [LiscensedNumber], [SSSNumber], [TIN], [Type], [Model], [BirthDay], [BirthMonth], [BirthYear]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" UpdateCommand="UPDATE [DriversRecords] SET [Username] = ?, [Password] = ?, [FirstName] = ?, [LastName] = ?, [MiddleName] = ?, [Address] = ?, [Age] = ?, [Gender] = ?, [ContactNumber] = ?, [PlateNumber] = ?, [Color] = ?, [Brand] = ?, [LiscensedNumber] = ?, [SSSNumber] = ?, [TIN] = ?, [Type] = ?, [Model] = ?, [BirthDay] = ?, [BirthMonth] = ?, [BirthYear] = ? WHERE [ID] = ?" DataFile="_private/records.mdb" SelectCommand="SELECT * FROM [DriversRecords]">
<DeleteParameters>
<asp:parameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:parameter Name="Username" Type="String" />
<asp:parameter Name="Password" Type="String" />
<asp:parameter Name="FirstName" Type="String" />
<asp:parameter Name="LastName" Type="String" />
<asp:parameter Name="MiddleName" Type="String" />
<asp:parameter Name="Address" Type="String" />
<asp:parameter Name="Age" Type="String" />
<asp:parameter Name="Gender" Type="String" />
<asp:parameter Name="ContactNumber" Type="String" />
<asp:parameter Name="PlateNumber" Type="String" />
<asp:parameter Name="Color" Type="String" />
<asp:parameter Name="Brand" Type="String" />
<asp:parameter Name="LiscensedNumber" Type="String" />
<asp:parameter Name="SSSNumber" Type="String" />
<asp:parameter Name="TIN" Type="String" />
<asp:parameter Name="Type" Type="String" />
<asp:parameter Name="Model" Type="String" />
<asp:parameter Name="BirthDay" Type="String" />
<asp:parameter Name="BirthMonth" Type="String" />
<asp:parameter Name="BirthYear" Type="String" />
<asp:parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:parameter Name="Username" Type="String" />
<asp:parameter Name="Password" Type="String" />
<asp:parameter Name="FirstName" Type="String" />
<asp:parameter Name="LastName" Type="String" />
<asp:parameter Name="MiddleName" Type="String" />
<asp:parameter Name="Address" Type="String" />
<asp:parameter Name="Age" Type="String" />
<asp:parameter Name="Gender" Type="String" />
<asp:parameter Name="ContactNumber" Type="String" />
<asp:parameter Name="PlateNumber" Type="String" />
<asp:parameter Name="Color" Type="String" />
<asp:parameter Name="Brand" Type="String" />
<asp:parameter Name="LiscensedNumber" Type="String" />
<asp:parameter Name="SSSNumber" Type="String" />
<asp:parameter Name="TIN" Type="String" />
<asp:parameter Name="Type" Type="String" />
<asp:parameter Name="Model" Type="String" />
<asp:parameter Name="BirthDay" Type="String" />
<asp:parameter Name="BirthMonth" Type="String" />
<asp:parameter Name="BirthYear" Type="String" />
</InsertParameters>
</asp:AccessDataSource>
这是我的 MobileInfo.aspx 代码
<asp:AccessDataSource runat="server" ID="AccessDataSource1" DeleteCommand="DELETE FROM [DriversRecords] WHERE [ID] = ?" InsertCommand="INSERT INTO [DriversRecords] ([Username], [Password], [FirstName], [LastName], [MiddleName], [Address], [Age], [Gender], [ContactNumber], [PlateNumber], [Color], [Brand], [LiscensedNumber], [SSSNumber], [TIN], [Type], [Model], [BirthDay], [BirthMonth], [BirthYear]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" UpdateCommand="UPDATE [DriversRecords] SET [Username] = ?, [Password] = ?, [FirstName] = ?, [LastName] = ?, [MiddleName] = ?, [Address] = ?, [Age] = ?, [Gender] = ?, [ContactNumber] = ?, [PlateNumber] = ?, [Color] = ?, [Brand] = ?, [LiscensedNumber] = ?, [SSSNumber] = ?, [TIN] = ?, [Type] = ?, [Model] = ?, [BirthDay] = ?, [BirthMonth] = ?, [BirthYear] = ? WHERE [ID] = ?" DataFile="_private/records.mdb" SelectCommand="SELECT * FROM [DriversRecords]">
<DeleteParameters>
<asp:parameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:parameter Name="Username" Type="String" />
<asp:parameter Name="Password" Type="String" />
<asp:parameter Name="FirstName" Type="String" />
<asp:parameter Name="LastName" Type="String" />
<asp:parameter Name="MiddleName" Type="String" />
<asp:parameter Name="Address" Type="String" />
<asp:parameter Name="Age" Type="String" />
<asp:parameter Name="Gender" Type="String" />
<asp:parameter Name="ContactNumber" Type="String" />
<asp:parameter Name="PlateNumber" Type="String" />
<asp:parameter Name="Color" Type="String" />
<asp:parameter Name="Brand" Type="String" />
<asp:parameter Name="LiscensedNumber" Type="String" />
<asp:parameter Name="SSSNumber" Type="String" />
<asp:parameter Name="TIN" Type="String" />
<asp:parameter Name="Type" Type="String" />
<asp:parameter Name="Model" Type="String" />
<asp:parameter Name="BirthDay" Type="String" />
<asp:parameter Name="BirthMonth" Type="String" />
<asp:parameter Name="BirthYear" Type="String" />
<asp:parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:parameter Name="Username" Type="String" />
<asp:parameter Name="Password" Type="String" />
<asp:parameter Name="FirstName" Type="String" />
<asp:parameter Name="LastName" Type="String" />
<asp:parameter Name="MiddleName" Type="String" />
<asp:parameter Name="Address" Type="String" />
<asp:parameter Name="Age" Type="String" />
<asp:parameter Name="Gender" Type="String" />
<asp:parameter Name="ContactNumber" Type="String" />
<asp:parameter Name="PlateNumber" Type="String" />
<asp:parameter Name="Color" Type="String" />
<asp:parameter Name="Brand" Type="String" />
<asp:parameter Name="LiscensedNumber" Type="String" />
<asp:parameter Name="SSSNumber" Type="String" />
<asp:parameter Name="TIN" Type="String" />
<asp:parameter Name="Type" Type="String" />
<asp:parameter Name="Model" Type="String" />
<asp:parameter Name="BirthDay" Type="String" />
<asp:parameter Name="BirthMonth" Type="String" />
<asp:parameter Name="BirthYear" Type="String" />
</InsertParameters>
</asp:AccessDataSource>
我希望有人可以在这里帮助我。谢谢。