express视图u8助手视图dynamicHelpers和helpers从2.x到3.x改成什么了

元总结---express框架之模板引擎、片段视图、视图助手 - 推酷
元总结---express框架之模板引擎、片段视图、视图助手
什么是元总结?元在英文里就是meta,元数据就是能够描述数据的数据,元编程就是能够操作代码的代码。那么,我今天想要说的元总结就是对总结进行总结的总结。是不是很绕,很好,这就是我要的效果。
每天写博文,其实就是一种总结,把这段时间学到的、感受到体验到的、做错的事情总结性的写下来,其实经常博文的主题,也就是不经意间的一个感悟,然后把这个主题大概记下来,通过早上来写出来。有一段时间每天睡前都会做一个事情,就是把今天做的番茄钟全部回顾一片,然后统计成数据,之后一段时间因为工作比较混杂,很难完成一个完整的番茄钟了,导致这个总结也都没做下去,这一点也是需要改进的。
早起已经坚持了半年了,前几天稍微回顾了下,发现这个过程中还是存在些许问题的:
1. 点30睡,6点醒还是没实现)晚睡主要原因是因为爱人,早醒没办法完成的原因是晚睡了,时间应该贴合实际所能达到的程度
2. 前一天晚上就写好番茄钟的每日计划被搁置了
3. 醒来的时候,有时候会看一会新闻
4. 每周获取的信息很大,而信息获取后没有梳理归纳
元总结的内容:
1. 番茄钟和番茄钟的总结需要继续
2. 临睡前要对后一天的番茄钟钟做好准备和规划,准备好第二天要做的事情,包括起床要做的
3. 计划暂改动为
4. 早醒后的时间是一天中效率最高的,不应该用来看新闻
5. 早醒后可以稍微运动运动
6. 每周应当对微信、博客或许的信息进行一次归纳总结;
7. 准备一杯水在床头,醒来就喝
--------------***分割线***----------------------
# 模板引擎
## 什么是模板引擎
模板引擎(Template Engine)是一个从页面模板根据一定的规则生成 HTML的工具,既建立一个HTML模板,插入可执行的代码。PHP、ASP、JSP、Vm都是模板引擎。
## 为什么不直接用HTML
如果一个网站全部资源都要用静态的HTML来展现,那一个网站要成千上万的静态页面,关键还很不灵活。
因此用嵌入逻辑的模板来构建网站,降低了动态网站的开发门槛,在通过MVC模式消除逻辑和页面的耦合程度。
## 模板引擎与控制器
***图1-3 模板引擎在MVC中的位置***
## 设置模板引擎
在app.js中,设置模板引擎和页面模板的位置。
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
```nodejs routes/index.js片段
res.render('index', { title: 'Express' });
``` res.render 的功能是调用模板引擎,并将其产生的页面直接返回给客户端。它接受两个参数,第一个是模板的名称,即 views 目录下的模板文件名,不包含文件的扩展名;第二个参数是传递给模板的数据,用于模板翻译。
```ejs index.ejs
&h1&&%= title %&&/h1&
Welcome to &%= title %&
``` 上面代码其中有两处 &%= title %&,用于模板变量显示,它们在模板翻译时会被替换成 Express,因为 res.render 传递了 { title: 'Express' }。
## Ejs的标签
ejs 的标签系统非常简单,它只有以下3种标签:
&% code %&:JavaScript 代码。
&%= code %&:显示替换过 HTML 特殊字符的内容。
&%- code %&:显示原始 HTML 内容。
## Layout.ejs
之前已经提到过,Layout.ejs相当于Java的装饰模式,会自动替换&%- body %&、&%- title %&等部分的内容。
可以在app.js中通过以下代码关闭。
```nodejs app.js片段
app.set('view options', {
layout: false
``` Layout是默认的装饰页面,还可以通过如下代码指定装饰的页面。
```nodejs index.js片段
function(req, res) {
res.render('userlist', {
title: '用户列表?后台管理系统',
layout: 'admin'
``` 这样就会自动套用admin.ejs来装饰了。
# 片段视图
片段视图 (partials),它就是一个页面的片段,通常是重复的内容,用于迭代显示。类似Jsp的 &c:foreach&来循环生成页面的方式。
Express3.x是某人不适用片段视图的,之前已经有说如何导入片段视图插件已经如何适用插件了,就不重复列举了。直接上个例子吧。
```nodejs app.js片段
app.get('/userlist',routes.userlist);
```nodejs routes/index.js片段
exports.userlist = function(req, res) {
res.render('list',{
title:'List',
items:[1988,'David','birthday','HelloWorld']
``` partial 是一个可以在视图中使用函数,它接受两个参数,第一个是片段视图的名称,第二个可以是一个对象或一个数组,如果是一个对象,那么片段视图中上下文变量引用的就是这个对象;如果是一个数组,那么其中每个元素依次被迭代应用到片段视图。片段视图中上下文变量名就是视图文件名,例如上面的'listitem'。
```ejs views/list.ejs
[list]&%- partial('listitem', items) %&[/list]
```ejs views/listitem.ejs
[*]&%= listitem %&
``` 运行结果:
# 视图助手
上一章节的partial就是一种视图助手,视图助手分为两种:静态视图助手和动态视图助手。Partial属于静态视图助手。
静态视图助手可以是任何类型的对象,包括接受任意参数的函数,但访问到的对象必须是与用户请求无关的,而动态视图助手只能是一个函数,这个函数不能接受参数,但可以访问 req 和 res 对象。
Express3.x中,视图助手的使用发生了变化,我试验了挺久的,终于知道如何解决了。边看代码边解释吧。
```nodejs app.js
var util = require('util');
var partials = require('express-partials');
// helpers
app.locals({
inspect: function(obj) {
return util.inspect(obj, true);
// dynamicHelpers
app.use(function(req,res,next){
res.locals.headers= req.
res.locals.dyvar = &This is a dynamic var!&;
app.use(app.router);
app.get('/helper',routes.helper);
``` 开始要先引入util模块,因为测试方法需要用到。
然后看备注可以看到helpers和dynamicHelpers在3.x中如何实现,特别要记住,一定要放在app.use(app.router);这句话之前,否则在locals里面设置的值是无效的。
然后就是添加路由规则模块的方法。
```nodejs routes/index.js片段
exports.helper =
function(req, res) {
res.render('helper', {
title: 'Helpers'
```ejs views/helper.ejs
&%= locals.dyvar %&
&%=inspect(locals.headers)%&
``` 注意:在页面中应用一定要记得要locals.headers
然后就可以运行看结果了。
已发表评论数()
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
主题不准确
没有分页内容
图片无法显示
视频无法显示
与原文不一致nodejs开发指南里面dynamicHelpers函数问题求解。。。 - CNode技术社区
这家伙很懒,什么个性签名都没有留下。
各位大虾,请教一个问题:nodejs开发指南注册那里,使用了dynamicHelpers函数,但是因为我现在用的是express3.x,木有这个函数了,请问如何解决啊???
在网上找了一下,是使用app.use(function(req, res, next){res.locals.user = req.session.user}),可还是出错,总是说user没有定义,无法把会话传到layout.ejs那里。。。。
我也遇到了这个问题,我的解决方案是在res.render里面定义user,不然传不过去。
暂时没找到更好的解决方法
请确认 app.use 是在 router 配置 [ 即 app.get(’/’… ] 之前。
。。。locals不就是为了解决这个问题的么。
解决方案:
将书中app.js的dynamicHelpers代码部分改为:
app.use(function(req, res, next){
var error = req.flash(‘error’);
var success = req.flash(‘success’);
res.locals.user = req.session.
res.locals.error = error.length ? error :
res.locals.success = success ? success :
并把此代码放在 app.use(app.router); 之前。
模板文件中改为下面类似结构:
&% if (!locals.user) { %&
&% if ( locals.error ) { %&
&% if ( locals.success ) { %&
res.render(&/user&,{user: req.session.user})
不是更优雅吗?
你的这个问题我也遇到过,我特地记录了下来http://www.9958.pw/post/dynamicHelpers_helpers 你也可以看看这篇文章对你也许有帮助
(主要是我当时做的demo可以参考参考)
那每个页面都要写上这一段,会重复额
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
服务器赞助商为
,存储赞助商为
,由提供应用性能服务。
新手搭建 Node.js 服务器,推荐使用无需备案的关于express 2.x 中app.dynamicHelpers怎么用在3.x中用res.locals取代? - CNode技术社区
这家伙很懒,什么个性签名都没有留下。
我是新手,就照着node.js权威指南书中敲得代码,epress3.x中app.dynamicHelpers已经被取消啦,百度了下说用res.locals方法,可我不知道怎么使用着个方法,页面报res no defined我的代码是这样的
在layout.ejs中如下来取值
&% if (res.locals.success) { %&
&div class=“alert alert-success”&
&%= success %&
&% if (res.locals.error) { %&
&div class=“alert alert-error”&
&%= error %&
然后在index.js中以下代码用来传值
newUser.save(function(err) {
if (err) {
res.locals.error=
return res.redirect(’/reg’);
req.session.user = newU
res.locals.success=“注册成功”;
res.redirect(’/’);
我也感觉这样代码有问题,可就是不知道怎么解决,求大神详细解答,我是新手,谢啦…
求大神解答啊???
res.locals.success is error , success is true.
签名: 交流群 《Node.js 服务器框架开发实战》
什么意思?不会又是利奥的助理吧?
我也在学这本书的例子,刚刚解决了这个问题:
在express3.0中要用req.flash()的话要安装connect-flash,直接npm install connect-flash安装,在app.js中加上:
var flash = require(‘connect-flash’);
app.use(flash());
app.use(function(req, res, next){
res.locals.user = req.session.
var err = req.flash(‘error’);
if(err.length)
res.locals.error =
res.locals.error =
var succ = req.flash(‘success’);
if(succ.length)
res.locals.success =
res.locals.success =
layout.ejs不用改,按书上的来就行。
don’t use res.locals.success , correct answer is use success
&% if (success) { %&
签名: 交流群 《Node.js 服务器框架开发实战》
需要一个中间件!+1
这样还是不行啊,我现在是不知道怎么用在express.3.x中不用app.dynamicHelpers 视图助手去实现页面间的传值问题???大神啊
res.locals.user = ...
EJS access
&%=user.xxx%&
签名: 交流群 《Node.js 服务器框架开发实战》
好吧,无法理解
我按照你的方法来了,可还是报错 :500 ReferenceError: D:\nodejs\microblog\views\layout.ejs:32&br/& 30| &ul class=“nav”& &br/& 31| &li class=“active”&&a href=&/&&首页&/a&&/li& &br/& && 32| &% if(!user){ %& &br/& 33| &li&&a href=&/login&&登陆&/a&&/li& &br/& 34| &li&&a href=&/reg&&注册&/a&&/li& &br/& 35| &% }else{ %& &br/&&br/&user is not defined
服务器能运行,就是在页面上报错,把user相关除掉就报success not defined 或 error not difined?? 什么情况啊?
按照楼上的方法做了,可还是报user not defined ,怎么解决啊?
你的router 是按照什么写的? 我后来了用了。。 可以!
这是router文件下的index.js内容
module.exports=function(app){
var crypto = require(‘crypto’)
var User = require(’…/models/user.js’)
var md5 = crypto.createHash(‘md5’);
app.get(’/’,function(req, res){
res.render(‘index’, { title: ‘MicroBlog’});
app.get(’/reg’,function(req, res){
res.render(‘reg’, { title: ‘Reg’});
//提交注册信息
app.post(’/reg’,function(req, res){
if (req.body[‘password-repeat’] != req.body[‘password’]) {
req.flush(“error”,“两次输入密码不一致”);
return res.redirect(’/reg’);
//生成口令的散列值
var password = md5.update(req.body.password).digest('base64');
var newUser = new User({
name: req.body.username,
password: password,
//检查用户名是否已经存在
User.get(, function(err, user) {
err = ‘Username already exists.’;
if (err) {
req.flush(“error”,err);
return res.redirect(’/reg’);
//如果不存在则新增用户
newUser.save(function(err) {
if (err) {
req.flush(&error&,err);
return res.redirect('/reg');
req.session.user = newU
req.flush(&success&,&注册成功&);
res.redirect('/');
app.get(’/login’,function(req, res){
res.render(‘login’, { title: ‘Login’});
app.post(’/login’,function(req, res){
var password = md5.update(req.body.password).digest(‘base64’);
User.get(req.body.username, function(err, user) {
if (!user) {
req.flush(“error”,‘用户不存在’);
return res.redirect(’/login’);
if (user.password != password) {
req.flush(“error”,‘用户口令错误’);
return res.redirect(’/login’);
req.session.user =
req.flush(“success”,‘登入成功’);
res.redirect(’/’);
app.get(’/logout’,function(req, res){
req.session.user =
req.flush(“success”,‘登出成功’);
res.redirect(’/’);
app.get(’/u/:user’,function(req, res){
res.render(‘index’, { title: ‘User’});
app.post(’/post’,function(req, res){
res.render(‘post’, { title: ‘Post’});
layout.ejs内容如下:
&!DOCTYPE html&
&html lang=“zh”&
&meta charset=“utf-8”&
&title&&%=title%&&/title&
&meta name=“viewport” content=“width=device- initial-scale=1.0”&
&link rel='stylesheet' href='/css/bootstrap.css' /&
&link rel='stylesheet' href='/css/bootstrap-responsive.css' /&
&style type=&text/css&&
padding-top: 60
padding-bottom: 40
&/style&
&/head&
&div class=&navbar navbar-fixed-top&&
&div class=&navbar-inner&&
&div class=&container&&
&a class=&btn btn-navbar&
data-toggle=&collapse& data-target=&.nav-collapse&&
&span class=&icon-bar&&&/span&
&span class=&icon-bar&&&/span&
&span class=&icon-bar&&&/span&
&a class=&brand& href=&/&&Microblog&/a&
&div class=&nav-collapse&&
&ul class=&nav&&
&li class=&active&&&a href=&/&&首页&/a&&/li&
&% if(!user){ %&
&li&&a href=&/login&&登陆&/a&&/li&
&li&&a href=&/reg&&注册&/a&&/li&
&% }else{ %&
&li&&a href=&/logout&&登出&/a&&/li&
&/ul&
&/div&
&/div&
&/div&
&/div&
&div id=&container& class=&container-fluid&&
&% if (success) { %&
&div class=&alert alert-success&&
&%=success %&
&/div&
&% if (error) { %&
&div class=&alert alert-error&&
&%=error %&
&/div&
&%- body %&
&hr /&
&p&&a href=&http:///& target=&_blank&&BYVoid&/a& 2012&/p&
&/footer&
&/div&
&script src=&/js/jquery-1.10.2.js&&&/script&
&script src=&/js/bootstrap.js&&&/script&
var nav_li= $(&.nav-collapse .nav li&)
nav_li.click(function(){
nav_li.removeClass();
$(this).addClass(&active&);
&/script&
&/body&
app.js是按照楼上给的方法加了个
var flash = require(‘connect-flash’);
app.use(flash());
app.use(function(req, res, next){
res.locals.user = req.session.
var err = req.flash(‘error’);
if(err.length)
res.locals.error =
res.locals.error =
var succ = req.flash(‘success’);
if(succ.length)
res.locals.success =
res.locals.success =
可还是报错 user not defined ,求指教啊?
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
服务器赞助商为
,存储赞助商为
,由提供应用性能服务。
新手搭建 Node.js 服务器,推荐使用无需备案的Error: System Cannot Find The File Specified: (Microsoft.SqlServer.Express.SQLEditors)
Jan 16, 2008
I know there are already several bug submissions on this error, and I am sure the cryptoAPI team is working to resolve this issue.. However... Is it possible that the CAPICOM update (KB931906) could have contributed to this issue? In my instance, I installed SQLServer 2005 Express w/ Adv Tools SP2 after a freash XP install. I checked it out, and everything worked fine. I updated windows (online) and now it gives this error. In fact, I cannot even run the un-install because the setup utility also hits the following error (as taken from the log file):
Microsoft SQL Server 2005 Setup beginning at Wed Jan 16 12:47:35 2008
Process ID
: 576
d:f8bcaa05210setup.exe Version: 2.0
Running: LoadResourcesAction at:
12:47:35
Complete: LoadResourcesAction at:
12:47:35, returned true
Running: ParseBootstrapOptionsAction at:
12:47:35
Loaded DLL:f8bcaa05210xmlrw.dll Version:2.0.3609.0
Complete: ParseBootstrapOptionsAction at:
12:47:35, returned false
Error: Action &ParseBootstrapOptionsAction& failed during execution.
Error information reported during run:
Could not parse command line due to datastore exception.
Source File Name: utillibpersisthelpers.cpp
Compiler Timestamp: Wed Jun 14 16:30:14 2006
Function Name: writeEncryptedString
Source Line Number: 124
----------------------------------------------------------
writeEncryptedString() failed
Source File Name: utillibpersisthelpers.cpp
Compiler Timestamp: Wed Jun 14 16:30:14 2006
Function Name: writeEncryptedString
Source Line Number: 123
----------------------------------------------------------
Error Code: 0x)
Windows Error Text: The system cannot find the file specified.
Source File Name: cryptohelpercryptsameusersamemachine.cpp
Compiler Timestamp: Wed Jun 14 16:28:04 2006
Function Name: sqls::CryptSameUserSameMachine:rotectData
Source Line Number: 50
2
Could not skip Component update due to datastore exception.
Source File Name: datastorecachedpropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:27:59 2006
Function Name: CachedPropertyCollection::findProperty
Source Line Number: 130
----------------------------------------------------------
Failed to find property &InstallMediaPath& {&SetupBootstrapOptionsScope&, &&, &576&} in cache
Source File Name: datastorepropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:28:01 2006
Function Name: SetupBootstrapOptionsScope.InstallMediaPath
Source Line Number: 44
----------------------------------------------------------
No collector registered for scope: &SetupBootstrapOptionsScope&
Running: ValidateWinNTAction at:
12:47:35
Complete: ValidateWinNTAction at:
12:47:35, returned true
Running: ValidateMinOSAction at:
12:47:35
Complete: ValidateMinOSAction at:
12:47:35, returned true
Running: PerformSCCAction at:
12:47:35
Complete: PerformSCCAction at:
12:47:35, returned true
Running: ActivateLoggingAction at:
12:47:35
Error: Action &ActivateLoggingAction& threw an exception during execution.
Error information reported during run:
Datastore exception while trying to write logging properties.
Source File Name: datastorecachedpropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:27:59 2006
Function Name: CachedPropertyCollection::findProperty
Source Line Number: 130
----------------------------------------------------------
Failed to find property &primaryLogFiles& {&SetupStateScope&, &&, &&} in cache
Source File Name: datastorepropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:28:01 2006
Function Name: SetupStateScope.primaryLogFiles
Source Line Number: 44
----------------------------------------------------------
No collector registered for scope: &SetupStateScope&
00E2CFC0Unable to proceed with setup, there was a command line parsing error. : 2
Error Code: 0x)
Windows Error Text: The system cannot find the file specified.
Source File Name: datastorepropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:28:01 2006
Function Name: SetupBootstrapOptionsScope.InstallMediaPath
Source Line Number: 44
Failed to create CAB file due to datastore exception
Source File Name: datastorecachedpropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:27:59 2006
Function Name: CachedPropertyCollection::findProperty
Source Line Number: 130
----------------------------------------------------------
Failed to find property &HostSetup& {&SetupBootstrapOptionsScope&, &&, &576&} in cache
Source File Name: datastorepropertycollection.cpp
Compiler Timestamp: Wed Jun 14 16:28:01 2006
Function Name: SetupBootstrapOptionsScope.HostSetup
Source Line Number: 44
----------------------------------------------------------
No collector registered for scope: &SetupBootstrapOptionsScope&
Message pump returning: 2
Since the Microsoft.SqlServer.Express.SQLEditors utilizes a crypto wrapper, givin the error above... would the CAPICOM update have affected things?
Brian Nichols
Similar Messages:
ADVERTISEMENT
May 27, 2008
Hi,I have a SQL Server Agent job set up to run a job that calls a dts package on the server.When I run the DTS Package manually, everything works fine and does what it is supposed to do. When I run the job, The job fails. If somebody had this error can you please help me outI am getting following error in my job...DTSRun: Loading...Error: - (); Provider Error: 0 (0) Error string: The system cannot find the file specified. Error source: Microsoft Data Transformation Services (DTS) Package Help file: sqldts.hlp Help context: 713. Process Exit Code 1. The step failed.could you please let me know what is the possible cause for the above error.Many Thanks,Madhu
Jan 31, 2007
Hi, I use the DTS 2000 Migration Wizard to migrate one of the DTS 2000 packages to SSIS.
The migration failed with the following error message: LogID=17#Time=6:31 PM#Level=DTSMW_LOGLEVEL_ERR#Source=Microsoft.SqlServer.Dts.MigrationWizard.Framework.Framework#Message=Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException: Failed to save package file &C:Documents and SettingsfuMy DocumentsVisual Studio 2005ProjectsKORTONKORTONProcessCubesMF.dtsx& with error 0x &The system cannot find the file specified.&. ---& System.Exception (0xC001100E): Failed to save package file &C:Documents and SettingsfuMy DocumentsVisual Studio 2005ProjectsKORTONKORTONProcessCubesMF.dtsx& with error 0x &The system cannot find the file specified.&.
at Microsoft.SqlServer.Dts.Runtime.Wrapper.ApplicationClass.SaveToXML(String FileName, IDTSPersist90 pPersistObj, IDTSEvents90 pEvents)
at Microsoft.SqlServer.Dts.Runtime.Application.SaveToXml(String fileName, Package package, IDTSEvents events)
--- End of inner exception stack trace ---
at Microsoft.SqlServer.Dts.Runtime.Application.SaveToXml(String fileName, Package package, IDTSEvents events)
at Microsoft.SqlServer.Dts.MigrationWizard.DTS9HelperUtility.DTS9Helper.SaveToXML(Package pkg, String sFileLocation)
at Microsoft.SqlServer.Dts.MigrationWizard.Framework.Framework.StartMigration(PackageInfo pInfo)Looking at the call stack, it looks like COM wrapper fails on SaveToXML.
Can someone tell me how I should workaround this problem? Thanks,Bobby Fu
Nov 25, 2007
System.Data.SqlClient.SqlError: Cannot open backup device '\.Tape0'. Operating system error 5(error not found). (Microsoft.SqlServer.express.Smo) i have only one sql instance and tape is istalled successfully.please help me to find solution for this error. Thanks,
Jun 2, 2008
In Management Studio i highlight my query and then click on 'Analyse query in Database Engine Advisor' but i get the following error message: &Failed to connect to an IPC Port: The system cannot find the file specified&.聽 Seems like if I reboot my computer it works one time then get the same error on the second time.I'm running developer edition with service pack 2.
Mar 8, 2007
Hi,I have a package which calls another package. It had been working fine for a while. Recently I changed the connection managers' names. Everything in the&parent package works fine. Database&has been updated correctly. But when it comes to calling the&child package it generates :OnError,CRPRCHMSQCZ,,Execute AMSClientAgentMaintenance,,,3/8/:38 PM,3/8/:38 PM,-,0x,Error 0x while preparing to load the package. The system cannot find the file specified..&&&&& (there is a period here instead of a file name)I tested the child package on the server. It works fine.&I connected the child package to the Execute Package Task by selecting from the packages on the server. So it is there for sure. Connection manager's name is read from the .dtsConfig. Child package&is executed from my development machine but not on the server. I made a small test package just to call this child package, it generates the same error...Any help is appreciatedGulden&
May 13, 2004
Windows 2000 Server SP4 + SQL Server 2000 Enterprise Editon SP3,RAID5.the windows event log give the following error information:I/O error 2(The system cannot find the file specified) detected during write at offset 0xc4000 in file 'D:Program FilesMicrosoft SQL ServerMSSQLdataGJSZBANK_Data.MDF'.
I have searched microsoft knowledge base and got this article:/default.aspx?scid=EN-US;828339but don't understand some contents in the topic:For example, if you encounter the following error message in the SQL Server Errorlog file, SQL Server encountered operating system error 2 when it uses a Windows API call to write to the tempdb primary database file:Error: 823, Severity: 24, State: 4 I/O error 2(The system cannot find the file specified.) detected during write at offset 0x00 in file 'D:Program FilesMicrosoft SQL ServerMSSQLdata empdb.mdf'
Because SQL Server has already successfully opened the file and did not receive an 揑nvalid Handle}

我要回帖

更多关于 u8助手视图设置 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信