01 2018 档案
摘要:$(this).children('td').eq(1).css({ "text-align" :"left" });
阅读全文
摘要://(1)返回filestream 其中:“text/plain”是文件MIME类型 public FileStreamResult download() { string fileName = "aaa.txt";//客户端保存的文件名 string filePath = Server.MapP...
阅读全文
摘要:if (file != null) { string path = Server.MapPath("~/Uploads/"); //获得服务器物理路径 if (!System.IO.Directory.Exists(path))//判断目录是否存在 ...
阅读全文
摘要:/// /// 增加一条数据 /// public int Add(string 表名,string 参数,string 参数值) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into ")...
阅读全文
摘要:private string GetGeneralContent(string strUrl) { string strMsg = string.Empty; try { WebRequest request = WebRequest.Create(strUrl); ...
阅读全文
摘要://.方法一:采用OleDB读取EXCEL文件: //打开excel 返回指定表中的所有数据 public DataSet ExcelToDS(string Path) { string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + P...
阅读全文
摘要://读取EXCEL public static DataSet LoadDataFromExcel(string filePath) //加载excel 返回DataSet内存数据库 { try { string strConn; strConn = "...
阅读全文
摘要:ALTER TABLE tab1 add id int identity primary key (注意:必须加identity,否则添加会失败) //导入excel时候 先把主键去掉 变为可为空,之后导入数据, 之后在额外添加主键 alter table tab1 drop column aaa; 删除列
阅读全文
摘要:DataSet ds = new DataSet(); DataTable dt= new DataTable("Customers"); ds.Tables.Add(dt); //添加这个表 读取DataSet中某一个DataTable: dt=ds.Tables[0];//指定第0个表 dt=ds.Tables["Customers"];//指定表名为“Customers”的表
阅读全文
摘要:select top 10 * from ComprehensiveShow where id not in(select top 40 id from ComprehensiveShow order by id) 意思是查询前40条数据,在查询不在前40条数据中的前10条数据 //select t
阅读全文
摘要:use test select isnull(max(CCC),0)+1 from [tab] --返回表中指定列名中有多少条数据 select count(0) from (select * from tab) as dhs_table --统计表中的行数 insert into Areas() values () ;select @@IDENTITY --用select @@iden...
阅读全文
摘要:function gget() { $.ajax({ type: "GET", url: "index", data: { U: '1234', P: '000' }, //async: true, ...
阅读全文
摘要://$.get("/Home/index/" + $("#S_BookName").val(), function (data) { //MVC控制器返回View(Model) 是没有绑定后的html页面 // console.log(data); // //var Number1 = data.indexOf("");//第二个索...
阅读全文
摘要:string UserName = context.Request["username"]; string PassWord = context.Request["pwd"]; //连接数据库 SqlConnection con = new SqlConnection("server=.;database=test;uid=...
阅读全文
摘要:textBox1.Text = dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss"); int[] arr = { 100, 20, 2, 4, 104, 1, 21, 101, 102, 201, 202 }; var data = arr.Where(n => n...
阅读全文
摘要:public ActionResult Index(string id)//主页 //参数string searchString 访问方式为index?searchString=xxxx 。参数string id 访问方式为index/x { string searchString = id; //return View...
阅读全文
摘要:return new HttpStatusCodeResult(HttpStatusCode.BadRequest); //HttpStatusCode statusCode 枚举 // HttpStatusCode.BadRequest = 400, public HttpStatusCodeResult(HttpStatusCode statusCode);//带参的构造函数 Htt...
阅读全文
摘要:模板(在Views下新建文件夹Shared;在Shared下新建模板页) 子页面(在views文件夹下新建视图_ViewStart)
阅读全文
摘要:public class HomeController : Controller { // GET: Home public ActionResult Index() //控制器名Home下默认的一个方法 { return View();//返回视图 } [HttpPost]//表单...
阅读全文
摘要://查询 //查询指定字符串出现的个数,类似于模糊查询select count(*) from Book where Name like '%字符串%' db.Book.Where(x => x.Name.Contains(txtName.Text.Trim())).Count(); //接收查询的数据 List bk = db.Book.ToList(); dataGridView1....
阅读全文
摘要:Navigator 跳转分为两个状态 跳转时关闭当前页 跳转时不跳转当前页 用redirect属性指定
阅读全文
摘要:.JSPage({ data: { input_data: [ { id: 1, unique: "unique1" }, { id: 2, unique: "unique2" }, ] }, //前部插入元素函数 addToFront: function (e) { //console.log(this.data.inpu...
阅读全文