一个经得起时间考验的人
ASP.net
ASP.net
VS2005:由于页中存在错误,无法切换到设计视图
六 6th
在使用VS2005时经常会出现无法从源视图切换到设计视图的问题。
—————————
Microsoft Visual Studio
—————————
由于页中存在错误,无法切换到设计视图。请更正错误列表中标记为“无法切换:”的所有错误,然后重试。
—————————
确定
—————————
原因是页面有未闭合的html标记,根据Visual Studio 2005的错误提示找到改过来。
类似的错误提示如下:
错误 29 无法切换视图: 此结束标记没有匹配的开始标记。 F:\SCFD\WebRoot\SCFD\PortalInfor\FocusNewsEdit.aspx 158 8 scfd
错误 41 无法切换视图: 验证 (HTML 4.01): 在标记中属性“class”只能指定一次。 F:\SCFD\WebRoot\SCFD\PrjOutgoingFile\PrjOutgoingFileWflow.aspx 196 38 scfd
即在错误列表中查看提示“”的错误,并更正即可。
无法在 Web 服务器上启动调试,您没有调试该服务器的权限
五 29th
Visual Studio调试ASP.net时出现
Microsoft 开发环境
—————————
试图运行项目时出错: 无法在 Web 服务器上启动调试。您没有调试该服务器的权限。
验证您是服务器上“Debugger Users”组的成员。
—————————
错误提示,在之前有一个解决这个问题的方法:Visual Studio .NET调试项目出错-验证您是服务器上“Debugger Users”组的成员
但是我这次遇到的这个问题却是IIS属性的配置未将 “启用集成 Windows 身份验证” 项选中。
通过inetmgr打开 Internet信息服务 在出错的网站中右击- "属性"->"目录安全性"->"身份验证和访问控制"编辑->选中“启用集成 Windows 身份验证” 项(如图)
这种情况可以出现的另一个错误是:
Microsoft 开发环境
—————————
试图运行项目时出错: 无法在 Web 服务器上启动调试。调试失败,因为没有启用集成 Windows 身份验证。有关更多信息,请单击“帮助”。
—————————
SQL中的保留关键字及INSERT INTO 语句的语法错误
五 29th
我一直使用数据库SQL Server开发ASP.net程序,但是今天却被ACCESS数据库折磨了。
使用ASP.net向ACCESS数据库中插入数据,相当简单的代码。
一开始是出现“操作必须使用一个可更新的查询”的错误,将存放ACCESS数据库的目录(需要对ACCESS数据库所在的目录)加上“Network”和“Network Service”的写入和修改的权限,解决!
随后的错误"INSERT INTO 语句的语法错误"就让我摸不着头脑了,Google了一些资料后才发现原来是我的ACCESS数据表的字段名使用了SQL的保留关键字。
将插入数据的SQL语句更改为:"insert into users([username],[desc]) values(‘"+username+ "’,'"+desc+"’)",即解决"INSERT INTO 语句的语法错误"的问题.
将保留关键字加上中括号([]).
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Data.OleDb;
- using System.Drawing;
- using System.Web;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.HtmlControls;
- namespace User
- {
- /// <summary>
- /// xr 的摘要说明。
- /// </summary>
- public class CreateUser : System.Web.UI.Page
- {
- protected System.Web.UI.WebControls.TextBox TBUsername;
- protected System.Web.UI.WebControls.TextBox TBDesc;
- protected System.Web.UI.WebControls.Label LabelState;
- protected System.Web.UI.WebControls.Button BTNCreateUser;
- private void Page_Load(object sender, System.EventArgs e)
- {
- // 在此处放置用户代码以初始化页面
- }
- private void BTNCreateUser_Click(object sender, System.EventArgs e)
- {
- string ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" + Server.MapPath("mdb/database.mdb");
- string username = this.TBUsername.Text.ToString();
- string desc = this.TBDesc.Text.ToString();
- string strSql = "insert into users([username],[desc]) values(‘"+username+ "’,'"+desc+"’)";
- System.Data.OleDb.OleDbConnection oleDbConnection = new System.Data.OleDb.OleDbConnection(ConnStr);
- System.Data.OleDb.OleDbCommand oleDbCommand = new System.Data.OleDb.OleDbCommand(strSql, oleDbConnection);
- try
- {
- oleDbCommand.Connection.Open();
- LabelState.Text ="Access数据库连接状态:" + oleDbConnection.State;
- oleDbCommand.ExecuteNonQuery();
- }
- catch(Exception ex)
- {
- Response.Write(ex.Message.ToString());
- }
- finally
- {
- oleDbCommand.Connection.Close();
- }
- }
- #region Web 窗体设计器生成的代码
- //代码省略
- #endregion
- }
以下为SQL中的保留关键字,大家在设计数据表时,尽量不要使用如下单词作为字段名称:
- action add aggregate all
- alter after and as
- asc avg avg_row_length auto_increment
- between bigint bit binary
- blob bool both by
- cascade case char character
- change check checksum column
- columns comment constraint create
- cross current_date current_time current_timestamp
- data database databases date
- datetime day day_hour day_minute
- day_second dayofmonth dayofweek dayofyear
- dec decimal default delayed
- delay_key_write delete desc describe
- distinct distinctrow double drop
- end else escape escaped
- enclosed enum explain exists
- fields file first float
- float4 float8 flush foreign
- from for full function
- global grant grants group
- having heap high_priority hour
- hour_minute hour_second hosts identified
- ignore in index infile
- inner insert insert_id int
- integer interval int1 int2
- int3 int4 int8 into
- if is isam join
- key keys kill last_insert_id
- leading left length like
- lines limit load local
- lock logs long longblob
- longtext low_priority max max_rows
- match mediumblob mediumtext mediumint
- middleint min_rows minute minute_second
- modify month monthname myisam
- natural numeric no not
- null on optimize option
- optionally or order outer
- outfile pack_keys partial password
- precision primary procedure process
- processlist privileges read real
- references reload regexp rename
- replace restrict returns revoke
- rlike row rows second
- select set show shutdown
- smallint soname sql_big_tables sql_big_selects
- sql_low_priority_updates sql_log_off sql_log_update
- sql_select_limit
- sql_small_result sql_big_result sql_warnings straight_join
- starting status string table
- tables temporary terminated text
- then time timestamp tinyblob
- tinytext tinyint trailing to
- type use using unique
- unlock unsigned update usage
- values varchar variables varying
- varbinary with write when
- where year year_month zerofill
如何清空Visual Studio 2003/2005中的最近项目列表
五 29th
Visual Studio使用一段时间后,在“文件”-“最近的项目”及“最近的文件”列表中会产生大量的选项。
一些无关紧要的项目或文件反而使自己无法迅速定位经常使用的项目。
因些经常清理Visual Studio 2003/2005/2008中的”-“最近的项目”及“最近的文件”列表还是很有意义的。
提供两个方法:
1.直接编辑注册表:
定位以下提供的注册表位置,删除其下对应的项即可。
对于Visual Studio 2003:
最近的项目: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1\ProjectMRUList
最近的文件: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1\FileMRUList
对于Visual Studio 2005:
最近的项目: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\ProjectMRUList
最近的文件:HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\FileMRUList
对于Visual Studio 2008:
最近的项目: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\ProjectMRUList
最近的文件:HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\FileMRUList
2.使用软件RecentProjectsDelete
Delete Links from the Recent Projects List on the Start Page of Visual Studio 2003, 2005 and 2008
可以通过 http://www.codeproject.com/KB/cs/Delete_Recent_Projects.aspx 下载源码(需要注册)编译后使用,或者直接本文提供的源码或者编码好的RecentProjectDelete下载。

附件:recentprojectsdelete_exe.zip(11456 Byte)
附件:recentprojectsdelete_sourcecode.zip(23918 Byte)
解决Windows 2003 cidaemon.exe进程CPU占用率高的方法
五 14th
Windows 2003 SP2的服务器,登录后发现CPU占用率一直在90左右,调出任务查看器后发现CPU都被进程cidaemon.exe占用,在查看相关资料后发现问题出在" Indexing service"上.
进程文件: cidaemon 或者 cidaemon.exe
服务名称: Indexing Service
描述: 在后台运行的Windows索引服务,用于帮助你搜索文件在下次变得更快。(本地和远程计算机上文件的索引内容和属性;通过灵活查询语言提供文件快速访问。);
是否为系统进程: 是
启动类型:自动
可执行文件路径: c:\WINDOWS\system32\cisvc.exe (注意此服务关联的可执行文件并不是cidaemon.exe)
解决方法:
禁用Indexing Service服务可以解决此问题,该服务一般较少使用,可以禁止使用,如果真正需要时再手工启动之.
通过“开始”->“运行”->“services.msc” 打开服务管理器,找到“Indexing Service”,停止此服务后修改“Indexing Service”的启动类型为“禁用”.
扩展阅读:
Visual SourceSafe(VSS)相关的8个环境变量
四 25th
Visual SourceSafe定义了8个环境变量,他们分别是:PATH、SSCURPRJ、SSDEBUGTIME、SSDIR、SSINI、SSINIENV、SSPWD、SSUSER
其中最常用的是以下四个:
PATH:定义了用户执行的命令在系统中的查找顺序,将VSS的安装目录“D:\Program Files\Microsoft Visual SourceSafe”添加到PATH变量后,用户就可以在命令行下直接使用SS、analyze等工具。
SSDIR:指定Microsoft Visual SourceSafe或在命令行下运行SS命令时默认打开的VSS数据库文件 Srcsafe.ini 的位置。
SSUSER:指定登录VSS的默认用户名
SSPWD:指定登录VSS的用户名密码
- Visual SourceSafe defines several environment variables, listed in the following table. You can set these variables in Windows for a variety of maintenance purposes.
- PATH
- Specifies the path for executable files. Add the path to your Win32 folder, which by default contains Visual SourceSafe program files. For example PATH=%PATH%;c:\Program Files\vss\win32.
- SSCURPRJ
- Overrides the project setting in Ss.ini and is most commonly used in writing batch files and macros for Visual SourceSafe.
- SSDEBUGTIME
- Specifies a file name that contains a 32-bit integer date/time stamp in binary format. This variable is used for setting dates and times for debugging.
- SSDIR
- Specifies the location of the Srcsafe.ini file for a Visual SourceSafe database to which to connect.
- SSINI
- Overrides the location of a user’s Ss.ini file, as provided in Users.txt.
- SSINIENV
- Specifies platform specifiers to load from the Srcsafe.ini and Ss.ini files. If this variable is not set, the defaults for Win32 systems are NT, Win, PC, UI for Visual SourceSafe Explorer components, and NT, Win, PC, CL for command line components.
- SSPWD
- Specifies the default password to be used for command line operations, in clear text,
- SSUSER
- Specifies the default user name to be used for command line operations.