teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

追記でコードを記載します。

2020/09/02 11:47

投稿

kwmr8416
kwmr8416

スコア6

title CHANGED
File without changes
body CHANGED
@@ -18,4 +18,90 @@
18
18
 
19
19
  ### 補足情報(FW/ツールのバージョンなど)
20
20
  visual studio 2017
21
- PostgreSQL 12.2
21
+ PostgreSQL 12.2
22
+
23
+ ### 追記(202009022027)
24
+ ご指摘ありがとうございます。再度コードを記載します。
25
+ ```
26
+ <asp:SqlDataSource ID="SqlDataSource1" runat="server"
27
+ ConnectionString="<%$ ConnectionStrings:sampleConnectionString %>"
28
+ DeleteCommand="DELETE FROM staffsample WHERE sscd = ?"
29
+ InsertCommand="INSERT INTO staffsample (stfnm, blood, sbt, knmnikin, knmyakin) VALUES (?, ?, ?, ?, ?)"
30
+ ProviderName="<%$ ConnectionStrings:sampleConnectionString.ProviderName %>"
31
+ SelectCommand="SELECT * FROM staffsample"
32
+ UpdateCommand="UPDATE staffsample SET stfnm = ?, blood = ?, sbt = ?, knmnikin = ?, knmyakin = ? WHERE sscd = ?">
33
+ <DeleteParameters>
34
+ <asp:Parameter Name="sscd" Type="Int32" />
35
+ </DeleteParameters>
36
+ <InsertParameters>
37
+ <asp:Parameter Name="stfnm" Type="String" />
38
+ <asp:Parameter Name="blood" Type="String" />
39
+ <asp:Parameter Name="sbt" Type="String" />
40
+ <asp:Parameter Name="knmnikin" Type="String" />
41
+ <asp:Parameter Name="knmyakin" Type="String" />
42
+ </InsertParameters>
43
+ <UpdateParameters>
44
+ <asp:Parameter Name="stfnm" Type="String" />
45
+ <asp:Parameter Name="blood" Type="String" />
46
+ <asp:Parameter Name="sbt" Type="String" />
47
+ <asp:Parameter Name="knmnikin" Type="String" />
48
+ <asp:Parameter Name="knmyakin" Type="String" />
49
+ <asp:Parameter Name="sscd" Type="Int32" />
50
+ </UpdateParameters>
51
+ </asp:SqlDataSource>
52
+ <br />
53
+ <asp:FormView ID="FormView1" runat="server" AllowPaging="True" DataSourceID="SqlDataSource1" DataKeyNames="sscd">
54
+ <EditItemTemplate>
55
+ <p>■基本情報</p>
56
+ <table>
57
+ <tr>
58
+ <td rowspan="3">氏名</td>
59
+ <td>氏名</td>
60
+ <td>
61
+ <asp:TextBox ID="stfnmTB" runat="server" Text='<%# Bind("stfnm") %>' />
62
+ </td>
63
+ </tr>
64
+ <tr>
65
+ <td>血液型</td>
66
+ <td>
67
+ <asp:DropDownList ID="bloodDDL" runat="server" SelectedValue='<%# Bind("blood") %>'>
68
+ <asp:ListItem></asp:ListItem>
69
+ <asp:ListItem>A型</asp:ListItem>
70
+ <asp:ListItem>B型</asp:ListItem>
71
+ <asp:ListItem>O型</asp:ListItem>
72
+ <asp:ListItem>AB型</asp:ListItem>
73
+ <asp:ListItem>不明</asp:ListItem>
74
+ </asp:DropDownList>
75
+ </td>
76
+ </tr>
77
+ <tr>
78
+ <td>性別</td>
79
+ <td>
80
+ <asp:DropDownList ID="sbtDDL" runat="server" SelectedValue='<%# Bind("sbt") %>'>
81
+ <asp:ListItem></asp:ListItem>
82
+ <asp:ListItem Value="男">男性</asp:ListItem>
83
+ <asp:ListItem Value="女">女性</asp:ListItem>
84
+ </asp:DropDownList>
85
+ </td>
86
+ </tr>
87
+ </table>
88
+ <p>■勤務条件</p>
89
+ <table>
90
+ <tr>
91
+ <td>希望時間</td>
92
+ <td>
93
+ <!--エラーが起きる箇所-->
94
+ <asp:CheckBox ID="knmnikinCB" runat="server" Checked='<%# Bind("knmnikin") %>' />
95
+ 日勤  
96
+ <br />
97
+ <asp:CheckBox ID="knmyakinCB" runat="server" Checked='<%# Bind("knmyakin") %>' />
98
+ 夜勤  
99
+ <br />
100
+ </td>
101
+ </tr>
102
+ </table>
103
+ <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="更新" />
104
+ &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="キャンセル" />
105
+ </EditItemTemplate>
106
+ </asp:FormView>
107
+ ```

1

タグとタイトルの修正

2020/09/02 11:47

投稿

kwmr8416
kwmr8416

スコア6

title CHANGED
@@ -1,1 +1,1 @@
1
- aspのチェックボックスの実装方法
1
+ ASP.NETのチェックボックスの実装方法
body CHANGED
File without changes