asp:FormView
을 사용하고 asp:TextBox
에 필요한 열을 바인딩하십시오. 예를 들어
: 당신이로드처럼
<asp:FormView runat="server" ID="FormView1" DataSourceID="SqlDataSource1">
<InsertItemTemplate>
<table>
<tr>
<td>
<asp:TextBox runat="server" ID="txtFoo" Text='<%# Bind("foo") %>' />
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtBar" Text='<%# Bind("bar") %>' />
</td>
</tr>
</table>
</InsertItemTemplate>
</asp:FormView>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" InsertCommand="INSERT INTO table1 (foo, bar) VALUES (@foo, @bar)" ConnectionString="<%$ ConnectionStrings:MyConnStringNameFromWebConfig%>">
<InsertParameters>
<asp:FormParameter Name="foo" FormField="foo" DbType="String" />
<asp:FormParameter Name="bar" FormField="bar" DbType="String" />
</InsertParameters>
</asp:SqlDataSource>
asp:FormView
이상한 행동 순간의 번호를 가지고, 내 경험을 공유하는 것이 행복 할 것이다, 당신의 질문을 자유롭게 작성하여
좀 더 설명해 주시겠습니까? –
@Sir 잠시만 기다려주세요 – abatishchev