请教C#高手,我做了一个aspx的动态页面,添加了一个FormView控件用来更新数据,但是我点击更新就报错??
<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ConnectionStr...
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:login_tableConnectionString %>"
DeleteCommand="DELETE FROM [ruzhi] WHERE [id] = @id"
InsertCommand="INSERT INTO [ruzhi] ([city], [ruzhishijian], [xingming], [pinyin], [sex], [bumen], [shangjiyouxiang], [zhiwei], [useid], [yeji], [xingzhi], [mail], [pwd], [current-time]) VALUES (@city, @ruzhishijian, @xingming, @pinyin, @sex, @bumen, @shangjiyouxiang, @zhiwei, @useid, @yeji, @xingzhi, @mail, @pwd, @[current-time])"
SelectCommand="SELECT * FROM [ruzhi] WHERE ([id] = @id)"
UpdateCommand="UPDATE [ruzhi] SET [city] = @city, [ruzhishijian] = @ruzhishijian, [xingming] = @xingming, [pinyin] = @pinyin, [sex] = @sex, [bumen] = @bumen, [shangjiyouxiang] = @shangjiyouxiang, [zhiwei] = @zhiwei, [useid] = @useid, [yeji] = @yeji, [xingzhi] = @xingzhi, [mail] = @mail, [pwd] = @pwd, [current-time] = @[current-time] WHERE [id] = @id">
<SelectParameters>
<asp:QueryStringParameter Name="id" QueryStringField="id" Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="id" Type="Int32" />
</DeleteParameters> 展开
ConnectionString="<%$ ConnectionStrings:login_tableConnectionString %>"
DeleteCommand="DELETE FROM [ruzhi] WHERE [id] = @id"
InsertCommand="INSERT INTO [ruzhi] ([city], [ruzhishijian], [xingming], [pinyin], [sex], [bumen], [shangjiyouxiang], [zhiwei], [useid], [yeji], [xingzhi], [mail], [pwd], [current-time]) VALUES (@city, @ruzhishijian, @xingming, @pinyin, @sex, @bumen, @shangjiyouxiang, @zhiwei, @useid, @yeji, @xingzhi, @mail, @pwd, @[current-time])"
SelectCommand="SELECT * FROM [ruzhi] WHERE ([id] = @id)"
UpdateCommand="UPDATE [ruzhi] SET [city] = @city, [ruzhishijian] = @ruzhishijian, [xingming] = @xingming, [pinyin] = @pinyin, [sex] = @sex, [bumen] = @bumen, [shangjiyouxiang] = @shangjiyouxiang, [zhiwei] = @zhiwei, [useid] = @useid, [yeji] = @yeji, [xingzhi] = @xingzhi, [mail] = @mail, [pwd] = @pwd, [current-time] = @[current-time] WHERE [id] = @id">
<SelectParameters>
<asp:QueryStringParameter Name="id" QueryStringField="id" Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asp:Parameter Name="id" Type="Int32" />
</DeleteParameters> 展开
展开全部
[current-time] = @[current-time] 这个写错了吧,使用默认的函数要用@么
追问
我将@去掉了,但还是报错啊!
追答
你把那个时间换成getDate()可以不
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
看你的 sql 语句 错误 。
追问
错在哪儿?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询