12 2010 档案
摘要:CS0016: 未能写入输出文件“c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\pdms\4bd00155\27c1f67\70sktsuj.dll”--“拒绝访问。 ”错误的处理: 出现CS0016的原因一般是临时目录的权限不够,至于为什么中途出现这种问题,我尚不清楚,解决的办法是给Windows目录下的临时文件夹Temp的安全选项卡中加入NetWork Service用户并赋予全权。
阅读全文
摘要:private void DataTable2Excel(System.Data.DataTable dtData) ...{ System.Web.UI.WebControls.DataGrid dgExport = null; System.Web.HttpContext curContext = System.Web.HttpContext.Current; System.IO.StringWriter strWriter = null; System.Web.UI.HtmlTextWriter htmlWriter = null; if (dtData != null) ...{ c
阅读全文
摘要:根据月份算这个月的天数。C# code DateTime d = new DateTime(2008,8,8); System.Globalization.Calendar c = new System.Globalization.GregorianCalendar(); int daysInAugust = c.GetDaysInMonth(d.Year, d.Month); // 31法定节假日that is a bit difficult, you might:C# code DateTime[] m_Holidays = new DateTime[] { new DateTime(20
阅读全文
摘要:查看你是不是更换了SA密码,进行企业管理器-管理-sql代理-属性-连接里有个sa密码,这里需要改一下密码
阅读全文
摘要:/************************ *用第二个方法,获取远程文件的大小 *************************///1.判断远程文件是否存在 ///fileUrl:远程文件路径,包括IP地址以及详细的路径private bool RemoteFileExists(string fileUrl) { bool result = false;//下载结果 WebResponse response = null; try { WebRequest req = WebRequest.Create(fileUrl); response = req.GetResponse();
阅读全文
摘要:字符串函数对二进制数据、字符串和表达式执行不同的运算。此类函数作用于CHAR、VARCHAR、 BINARY、 和VARBINARY 数据类型以及可以隐式转换为CHAR 或VARCHAR的数据类型。可以在SELECT 语句的SELECT 和WHERE 子句以及表达式中使用字符串函数。常用的字符串函数有:一、字符转换函数1、ASCII()返回字符表达式最左端字符的ASCII 码值。在ASCII()函数中,纯数字的字符串可不用‘’括起来,但含其它字符的字符串必须用‘’括起来使用,否则会出错。2、CHAR()将ASCII 码转换为字符。如果没有输入0 ~ 255 之间的ASCII 码值,CHAR()
阅读全文
摘要:1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断select*frompeoplewherepeopleIdin(selectpeopleIdfrompeoplegroupbypeopleIdhavingcount(peopleId)>1)例二:select * from testtablewhere numeber in (select number from people group by number having count(number) > 1 )可以查出testtable表中number相同的记录2、删除表中多余的重复记录,重复记录是根据单
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Xml;using System.Xml.Xsl;using System.IO;using System.Data.OleDb;using System.Data.Odbc;using System.Text;us
阅读全文
摘要:protected void Page_Load(object sender, EventArgs e) { string paths = Server.MapPath(""); DataSet ds3= getcsv(paths, paths+"2010年淘趣后台导入价格表样式20100828.csv"); GridView1.DataSource = ds3; GridView1.DataBind(); } private DataSet getcsv(string filepath, string file...
阅读全文
摘要:using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class Page : System.Web.UI.Page{p
阅读全文
摘要:using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class Page : System.Web.UI.Page{p
阅读全文
摘要:1. 打开新的窗口并传送参数: CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="++"')</script>")2.为按钮添加对话框CodeCode hig
阅读全文
摘要:SQL Server 2000订阅与发布的具体操作同步过程 一、准备工作,如果完成则可跳过。 1、内网DB服务器作为发布服务器,外网DB服务器作为订阅服务器。 发布服务器和订阅服务器上分别创建Windows用户jl,密码jl,隶属于administrators,注意要保持一致。 2、发布服务器上创建一个共享目录,作为发布快照文件的存放目录。例如:在D盘根目录下建文件夹名为SqlCopy,设置用户jl,权限为完全控制。 3、确定发布服务器和订阅服务器的数据库autoweb保持一致。 4、在发布服务器和订阅服务器的SQL Server中创建用户登陆名jl,作为发布数据库autoweb的拥有者(设置
阅读全文
摘要:int GetAppearTimes(string str1,string str2){ int i=0; while(str1.IndexOf(str2)>=0){ str1=str1.Substring(str1.IndexOf(str2)+str2.Length); i++; } return i; } int GetAppearTimes(string str1,string str2){ Regex ex=new Regex(str2); return ex.Matches(str1).Count; } Regex.Matches(str1,str2).Count;本文来自CS
阅读全文