2012年2月1日
摘要: SQL脚本修改表结构 新建表:create table [表名]([自动编号字段] int IDENTITY (1,1) PRIMARY KEY ,[字段1] nVarChar(50) default '默认值' null ,[字段2] ntext null ,[字段3] datetime,[字段4 阅读全文
posted @ 2012-02-01 17:05 cw_volcano 阅读(540) 评论(0) 推荐(0) 编辑
摘要: string数组类型转换为int数组.方法一:ConvertAll的用法publicstaticintStrToInt(stringstr){returnint.Parse(str);}string[]arrs=newstring[]{"100","300","200"};int[]arri=Array.ConvertAll(arrs,newConverter<string,int>(StrToInt));方法二:使用数组循环分别转换。string[]str1=newstring[]{"100",&qu 阅读全文
posted @ 2012-02-01 12:01 cw_volcano 阅读(2954) 评论(0) 推荐(0) 编辑
摘要: 1.验证提示信息:View:<%=Html.ValidationSummary("") %>Controller:ModelState.AddModelError("Error", "您提交的信息还未通过审核!");if ((!this.ModelState.IsValid)) return this.RedirectWithErrors(this.View(DeleteViewName, viewModel), viewModel.GetErrors());2.确认数据库连接没有忘记关闭:protected overri 阅读全文
posted @ 2012-02-01 08:56 cw_volcano 阅读(370) 评论(0) 推荐(1) 编辑