AccessデータのListViewでの編集不具合の解決
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
閲覧総計:&counter(); (本日:&counter(today); 昨日...
ListViewでAccessデータを「編集」する際、「オプティミス...
を設定すると編集決定時の「更新」ボタンを押した際、「1 つ...
タの値が設定されていません。 」のエラーが発生し動かなくな...
この問題の解決方法を備忘目的で記載しておきます。(3.5) ...
※ListViewでAccessデータを「編集」する際、「オプトミスティ...
を設定しなければ、問題なく「編集」機能が動作します。
【原因】
自動生成されたUpdateCommandの「?」の数は7つなのに対し...
Parameter行がは5行と2行不足している事が原因。
UpdateCommand="UPDATE [名簿] SET [名前] = ?, [年齢] = ? ...
<UpdateParameters>
<asp:Parameter Name="名前" Type="String" />
<asp:Parameter Name="年齢" Type="Int16" />
<asp:Parameter Name="original_ID" Type="Int32" />
<asp:Parameter Name="original_名前" Type="String" />
<asp:Parameter Name="original_年齢" Type="Int16" />
</UpdateParameters>
【解決方法】
自動生成されたUpdateCommandの「?」の数に合わせて、Param...
<asp:Parameter Name="original_名前" Type="String" />
<asp:Parameter Name="original_年齢" Type="Int16" />
の2行を追加してやる。
<UpdateParameters>
<asp:Parameter Name="名前" Type="String" />
<asp:Parameter Name="年齢" Type="Int16" />
<asp:Parameter Name="original_ID" Type="Int32" />
<asp:Parameter Name="original_名前" Type="String" />
&color(crimson){<asp:Parameter Name="original_名前"...
<asp:Parameter Name="original_年齢" Type="Int16" />
&color(crimson){<asp:Parameter Name="original_年齢"...
</UpdateParameters>
Accessデータベース名:MyDB.mdb
テーブル名:名簿
|~フィールド名|~データ型|~フィールドサイズ|
|ID (主キー)|オートナンバー型|長整数型|
|名前|テキスト型|50|
|年齢|数値型|整数型|
※ASP.NET3.5ではAccess2007のDBファイル形式(*.accdb)は利用...
DBファイルは「Acces2002-2003形式(*.mdb)」で保存してASP.NE...
開発環境:VWD2008
サーバ:Windows Server2003 + .NET Framework3.5
【機能】ListViewの「編集」ボタンでAccessデータを編集する。
【稼働画面】
#ref(ListViewEditOpt.JPG);
「編集」機能が正しく動く様になった自動生成全コード
【ListViewEditOpt.aspx】[3.5]
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitiona...
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
ListViewでのAccessデータの編集機能の確認 09...
(ID:オートナンバー型、同時実行制御)<br />
<br />
<asp:ListView ID="ListView1" runat="server" Data...
DataSourceID="AccessDataSource1">
<ItemTemplate>
<tr style="">
<td>
<asp:Button ID="EditButton" runa...
</td>
<td>
<asp:Label ID="IDLabel" runat="s...
</td>
<td>
<asp:Label ID="名前Label" runat=...
</td>
<td>
<asp:Label ID="年齢Label" runat=...
</td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr style="">
<td>
<asp:Button ID="EditButton" runa...
</td>
<td>
<asp:Label ID="IDLabel" runat="s...
</td>
<td>
<asp:Label ID="名前Label" runat=...
</td>
<td>
<asp:Label ID="年齢Label" runat=...
</td>
</tr>
</AlternatingItemTemplate>
<EmptyDataTemplate>
<table runat="server" style="">
<tr>
<td>
データは返されませんでした。...
</tr>
</table>
</EmptyDataTemplate>
<InsertItemTemplate>
<tr style="">
<td>
<asp:Button ID="InsertButton" ru...
<asp:Button ID="CancelButton" ru...
</td>
<td>
</td>
<td>
<asp:TextBox ID="名前TextBox" ru...
</td>
<td>
<asp:TextBox ID="年齢TextBox" ru...
</td>
</tr>
</InsertItemTemplate>
<LayoutTemplate>
<table runat="server">
<tr runat="server">
<td runat="server">
<table ID="itemPlaceholderCo...
<tr runat="server" style...
<th runat="server">
</th>
<th runat="server">
ID</th>
<th runat="server">
名前</th>
<th runat="server">
年齢</th>
</tr>
<tr ID="itemPlaceholder"...
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server" style="">
</td>
</tr>
</table>
</LayoutTemplate>
<EditItemTemplate>
<tr style="">
<td>
<asp:Button ID="UpdateButton" ru...
<asp:Button ID="CancelButton" ru...
Text="キャンセル" />
</td>
<td>
<asp:Label ID="IDLabel1" runat="...
</td>
<td>
<asp:TextBox ID="名前TextBox" ru...
</td>
<td>
<asp:TextBox ID="年齢TextBox" ru...
</td>
</tr>
</EditItemTemplate>
<SelectedItemTemplate>
<tr style="">
<td>
<asp:Button ID="EditButton" runa...
</td>
<td>
<asp:Label ID="IDLabel" runat="s...
</td>
<td>
<asp:Label ID="名前Label" runat=...
</td>
<td>
<asp:Label ID="年齢Label" runat=...
</td>
</tr>
</SelectedItemTemplate>
</asp:ListView>
<asp:AccessDataSource ID="AccessDataSource1" run...
ConflictDetection="CompareAllValues" DataFil...
DeleteCommand="DELETE FROM [名簿] WHERE [ID]...
InsertCommand="INSERT INTO [名簿] ([ID], [名...
OldValuesParameterFormatString="original_{0}"
SelectCommand="SELECT [ID], [名前], [年齢] F...
UpdateCommand="UPDATE [名簿] SET [名前] = ?,...
<DeleteParameters>
<asp:Parameter Name="original_ID" Type="...
<asp:Parameter Name="original_名前" Type...
<asp:Parameter Name="original_年齢" Type...
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="名前" Type="String"...
<asp:Parameter Name="年齢" Type="Int16" />
<asp:Parameter Name="original_ID" Type="...
<asp:Parameter Name="original_名前" Type...
<asp:Parameter Name="original_名前" Type...
<asp:Parameter Name="original_年齢" Type...
<asp:Parameter Name="original_年齢" Type...
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="ID" Type="Int32" />
<asp:Parameter Name="名前" Type="String"...
<asp:Parameter Name="年齢" Type="Int16" />
</InsertParameters>
</asp:AccessDataSource>
</div>
</form>
</body>
</html>
【参考にしたページ】
該当なし
- http://www.coachcanadaoutlet.ca http://www.prada-outlet...
- http://www.oakleysunglasses.ar.com/ http://www.oakley--...
- http://www.outletonline-michaelkors.com/ http://www.mic...
- 2015-10-6 xiaozhengm http://www.louisvuitton-lvoutl...
- http://www.cybermondaydeals.in.net http://www.michaelk...
- http://www.marcjacobs.us.com/ http://www.designerhandba...
- 20190109 junda http://www.coach-factory-outlet-online.u...
- http://www.oakleysunglassese.us.com/ http://www.oakley...
- http://www.oakleysunglassesa.us.com/ http://www.oakley-...
- http://www.oakleysunglassesa.us.com/ http://www.oakley-...
- http://www.zapyapc.com/zapya-for-pc-free-download-windo...
- http://www.outletsmichaelkors.us.com http://www.christi...
- http://www.mobogenieforpcc.com http://www.snapchatforpc...
- http://www.ucbrowserforpcc.com -- [[hbv]] &new{2016-09-...
- nice information it is.http://www.zapyapc.com/ http://...
- http://www.nike-id.us/ nike id http://www.katespadeo...
- Dailymotion video downloader Try http://dailymotionvid...
- This is really informative. https://www.imoforwindowsp...
- Download Gesture lock screen application from http://ge...
- Invest in Dubai properties & buy property in Dubai sta...
- https://www.srsroofing.ca/ -- [[https://www.srsroofing....
- https://www.srsroofing.ca/ -- [[https://www.srsroofing....
- https://ring-hope.com/product/custom-bjj-gi-limited-can...
#comment_nospam
#vote(参考になった[2],ふつう[0],参考にならなかった[0])
終了行:
閲覧総計:&counter(); (本日:&counter(today); 昨日...
ListViewでAccessデータを「編集」する際、「オプティミス...
を設定すると編集決定時の「更新」ボタンを押した際、「1 つ...
タの値が設定されていません。 」のエラーが発生し動かなくな...
この問題の解決方法を備忘目的で記載しておきます。(3.5) ...
※ListViewでAccessデータを「編集」する際、「オプトミスティ...
を設定しなければ、問題なく「編集」機能が動作します。
【原因】
自動生成されたUpdateCommandの「?」の数は7つなのに対し...
Parameter行がは5行と2行不足している事が原因。
UpdateCommand="UPDATE [名簿] SET [名前] = ?, [年齢] = ? ...
<UpdateParameters>
<asp:Parameter Name="名前" Type="String" />
<asp:Parameter Name="年齢" Type="Int16" />
<asp:Parameter Name="original_ID" Type="Int32" />
<asp:Parameter Name="original_名前" Type="String" />
<asp:Parameter Name="original_年齢" Type="Int16" />
</UpdateParameters>
【解決方法】
自動生成されたUpdateCommandの「?」の数に合わせて、Param...
<asp:Parameter Name="original_名前" Type="String" />
<asp:Parameter Name="original_年齢" Type="Int16" />
の2行を追加してやる。
<UpdateParameters>
<asp:Parameter Name="名前" Type="String" />
<asp:Parameter Name="年齢" Type="Int16" />
<asp:Parameter Name="original_ID" Type="Int32" />
<asp:Parameter Name="original_名前" Type="String" />
&color(crimson){<asp:Parameter Name="original_名前"...
<asp:Parameter Name="original_年齢" Type="Int16" />
&color(crimson){<asp:Parameter Name="original_年齢"...
</UpdateParameters>
Accessデータベース名:MyDB.mdb
テーブル名:名簿
|~フィールド名|~データ型|~フィールドサイズ|
|ID (主キー)|オートナンバー型|長整数型|
|名前|テキスト型|50|
|年齢|数値型|整数型|
※ASP.NET3.5ではAccess2007のDBファイル形式(*.accdb)は利用...
DBファイルは「Acces2002-2003形式(*.mdb)」で保存してASP.NE...
開発環境:VWD2008
サーバ:Windows Server2003 + .NET Framework3.5
【機能】ListViewの「編集」ボタンでAccessデータを編集する。
【稼働画面】
#ref(ListViewEditOpt.JPG);
「編集」機能が正しく動く様になった自動生成全コード
【ListViewEditOpt.aspx】[3.5]
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitiona...
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
ListViewでのAccessデータの編集機能の確認 09...
(ID:オートナンバー型、同時実行制御)<br />
<br />
<asp:ListView ID="ListView1" runat="server" Data...
DataSourceID="AccessDataSource1">
<ItemTemplate>
<tr style="">
<td>
<asp:Button ID="EditButton" runa...
</td>
<td>
<asp:Label ID="IDLabel" runat="s...
</td>
<td>
<asp:Label ID="名前Label" runat=...
</td>
<td>
<asp:Label ID="年齢Label" runat=...
</td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr style="">
<td>
<asp:Button ID="EditButton" runa...
</td>
<td>
<asp:Label ID="IDLabel" runat="s...
</td>
<td>
<asp:Label ID="名前Label" runat=...
</td>
<td>
<asp:Label ID="年齢Label" runat=...
</td>
</tr>
</AlternatingItemTemplate>
<EmptyDataTemplate>
<table runat="server" style="">
<tr>
<td>
データは返されませんでした。...
</tr>
</table>
</EmptyDataTemplate>
<InsertItemTemplate>
<tr style="">
<td>
<asp:Button ID="InsertButton" ru...
<asp:Button ID="CancelButton" ru...
</td>
<td>
</td>
<td>
<asp:TextBox ID="名前TextBox" ru...
</td>
<td>
<asp:TextBox ID="年齢TextBox" ru...
</td>
</tr>
</InsertItemTemplate>
<LayoutTemplate>
<table runat="server">
<tr runat="server">
<td runat="server">
<table ID="itemPlaceholderCo...
<tr runat="server" style...
<th runat="server">
</th>
<th runat="server">
ID</th>
<th runat="server">
名前</th>
<th runat="server">
年齢</th>
</tr>
<tr ID="itemPlaceholder"...
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server" style="">
</td>
</tr>
</table>
</LayoutTemplate>
<EditItemTemplate>
<tr style="">
<td>
<asp:Button ID="UpdateButton" ru...
<asp:Button ID="CancelButton" ru...
Text="キャンセル" />
</td>
<td>
<asp:Label ID="IDLabel1" runat="...
</td>
<td>
<asp:TextBox ID="名前TextBox" ru...
</td>
<td>
<asp:TextBox ID="年齢TextBox" ru...
</td>
</tr>
</EditItemTemplate>
<SelectedItemTemplate>
<tr style="">
<td>
<asp:Button ID="EditButton" runa...
</td>
<td>
<asp:Label ID="IDLabel" runat="s...
</td>
<td>
<asp:Label ID="名前Label" runat=...
</td>
<td>
<asp:Label ID="年齢Label" runat=...
</td>
</tr>
</SelectedItemTemplate>
</asp:ListView>
<asp:AccessDataSource ID="AccessDataSource1" run...
ConflictDetection="CompareAllValues" DataFil...
DeleteCommand="DELETE FROM [名簿] WHERE [ID]...
InsertCommand="INSERT INTO [名簿] ([ID], [名...
OldValuesParameterFormatString="original_{0}"
SelectCommand="SELECT [ID], [名前], [年齢] F...
UpdateCommand="UPDATE [名簿] SET [名前] = ?,...
<DeleteParameters>
<asp:Parameter Name="original_ID" Type="...
<asp:Parameter Name="original_名前" Type...
<asp:Parameter Name="original_年齢" Type...
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="名前" Type="String"...
<asp:Parameter Name="年齢" Type="Int16" />
<asp:Parameter Name="original_ID" Type="...
<asp:Parameter Name="original_名前" Type...
<asp:Parameter Name="original_名前" Type...
<asp:Parameter Name="original_年齢" Type...
<asp:Parameter Name="original_年齢" Type...
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="ID" Type="Int32" />
<asp:Parameter Name="名前" Type="String"...
<asp:Parameter Name="年齢" Type="Int16" />
</InsertParameters>
</asp:AccessDataSource>
</div>
</form>
</body>
</html>
【参考にしたページ】
該当なし
- http://www.coachcanadaoutlet.ca http://www.prada-outlet...
- http://www.oakleysunglasses.ar.com/ http://www.oakley--...
- http://www.outletonline-michaelkors.com/ http://www.mic...
- 2015-10-6 xiaozhengm http://www.louisvuitton-lvoutl...
- http://www.cybermondaydeals.in.net http://www.michaelk...
- http://www.marcjacobs.us.com/ http://www.designerhandba...
- 20190109 junda http://www.coach-factory-outlet-online.u...
- http://www.oakleysunglassese.us.com/ http://www.oakley...
- http://www.oakleysunglassesa.us.com/ http://www.oakley-...
- http://www.oakleysunglassesa.us.com/ http://www.oakley-...
- http://www.zapyapc.com/zapya-for-pc-free-download-windo...
- http://www.outletsmichaelkors.us.com http://www.christi...
- http://www.mobogenieforpcc.com http://www.snapchatforpc...
- http://www.ucbrowserforpcc.com -- [[hbv]] &new{2016-09-...
- nice information it is.http://www.zapyapc.com/ http://...
- http://www.nike-id.us/ nike id http://www.katespadeo...
- Dailymotion video downloader Try http://dailymotionvid...
- This is really informative. https://www.imoforwindowsp...
- Download Gesture lock screen application from http://ge...
- Invest in Dubai properties & buy property in Dubai sta...
- https://www.srsroofing.ca/ -- [[https://www.srsroofing....
- https://www.srsroofing.ca/ -- [[https://www.srsroofing....
- https://ring-hope.com/product/custom-bjj-gi-limited-can...
#comment_nospam
#vote(参考になった[2],ふつう[0],参考にならなかった[0])
ページ名: