byte[] bytes = Encoding.GetEncoding(1252).GetBytes(m_orderdetail.productDescCN);//((string)reader["Note"]);
m_orderdetail.productDescCN = Encoding.UTF8.GetString(bytes);
Error: 5133 SQL Server while attaching the Database
Today, one of my support executive was trying to attach a database received from client in SQL SERVER 2008 R2. He had received only one file, DemoDB.mdf
Now when he was attaching that file, SQL server is giving below error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Attach database failed for Server 'XXX-XX--XX'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.2500.0+((KJ_PCU_Main).110617-0038+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Directory lookup for the file "G:\SQLLOG\NAV_D_CQPA_370B_Log.ldf" failed with the operating system error 3(The system cannot find the path specified.). (Microsoft SQL Server, Error: 5133)
------------------------------
I checked the file path during attach. I found that as he does not have the log file. SQL was taking a random path which is not exist in the system. I removed the ldf file and the database is attached successfully.
Now when he was attaching that file, SQL server is giving below error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Attach database failed for Server 'XXX-XX--XX'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.2500.0+((KJ_PCU_Main).110617-0038+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Directory lookup for the file "G:\SQLLOG\NAV_D_CQPA_370B_Log.ldf" failed with the operating system error 3(The system cannot find the path specified.). (Microsoft SQL Server, Error: 5133)
------------------------------
I checked the file path during attach. I found that as he does not have the log file. SQL was taking a random path which is not exist in the system. I removed the ldf file and the database is attached successfully.
ေလ႕လာစရာ နည္းပညာမ်ား
1. SQL Server for developer
2. IIS 8
3. dot Net Framework 4.5
4. Entity Framework
5. WCF & RIA WCF
6. Business Silverlight 5
7. LINQ
8. T-SQL
2. IIS 8
3. dot Net Framework 4.5
4. Entity Framework
5. WCF & RIA WCF
6. Business Silverlight 5
7. LINQ
8. T-SQL
HTTP Error 404.17
You may receive the following error: HTTP Error 404.17 - Not Found. The requested content appears to be script and will not be served by the static file handler.
This is because .Net isn't configured correctly in IIS.
I ran into this in Windows Server 8 under IIS - Even after installing .Net 3.5 (and hence 2.0) IIS wasn't configured properly - So the static file handler was trying to handle .aspx requests - Resulting in this error.
The fix is simple:
- Launch Command Prompt - Start - cmd.exe
- cd C:\Windows\Microsoft.NET\Framework64\v2.0.50727
- aspnet_regiis -ir
You should see output like:
Start installing ASP.NET (2.0.50727).
................
Finished installing ASP.NET (2.0.50727).
At this point if you refresh your page it should work properly.
Subscribe to:
Posts (Atom)