<asp:FormView>
<InsertItemTemplate>
<table>
<td>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Date") %>'></asp:TextBox>
<asp:LinkButton ID="LinkButton1" runat="server"
onclick="LinkButton1_Click" CommandName="Insert">保存</asp:LinkButton>
</td>
</table>
</InsertItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
InsertCommand="INSERT INTO CompanyNews(Name, TheContent, Date) VALUES (@Name, @TheContent, @Date)"
<InsertParameters>
<asp:Parameter Name="Name" />
<asp:Parameter Name="TheContent" />
<asp:Parameter Name="Date" />
</InsertParameters>
</asp:SqlDataSource>点击按钮的时候会报错。按钮直接选了CommandName="Insert";如何把Bind("Date")变成DateTime插入数据库?
<InsertItemTemplate>
<table>
<td>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Date") %>'></asp:TextBox>
<asp:LinkButton ID="LinkButton1" runat="server"
onclick="LinkButton1_Click" CommandName="Insert">保存</asp:LinkButton>
</td>
</table>
</InsertItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
InsertCommand="INSERT INTO CompanyNews(Name, TheContent, Date) VALUES (@Name, @TheContent, @Date)"
<InsertParameters>
<asp:Parameter Name="Name" />
<asp:Parameter Name="TheContent" />
<asp:Parameter Name="Date" />
</InsertParameters>
</asp:SqlDataSource>点击按钮的时候会报错。按钮直接选了CommandName="Insert";如何把Bind("Date")变成DateTime插入数据库?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货