After analyzing through the event probe in the morning, you are always unwilling to execute the script clearly in the SQL service. Why is it wrong to run the script as a database installation file? I decided to trace the source code to find the cause.
Fortunately, I have the source code 3.3.7 in my hand. After creating a new site, I open vs2003 and set the breakpoint (sorry to tell everyone, although dnn has so many versions, but I have never read the source code well. It is really a success, so it took me a lot of time to set the position of the breakpoint, and dnn is really strong ). The breakpoint can be set ~ In the public function install () as Boolean method of \ dotnetnuke \ Components \ resourceinstaller \ painstaller. VB
On the factory. getdnninstaller. Install (_ dnnfolders) statement, this is to install the files in the specified directory through the factory method.
Another breakpoint is set in the protected overridable function batchsql (byval sqlfile as pafile) as Boolean method in padnninstallerbase. VB. After tracking found that dnn will first get your installation file encoding, UTF-8 UTF-7, utf16bigendian and so on, and then according to the encoding to get the script in the file and then execute.
The problem was finally found here, and my database installation script was encoded into the UTF-7 (ANSI), so after the dnn re-encoding, "'" turned into "'' ", "+" is also missing. As for why this is the case, I have no energy to analyze it for the moment. After you change the installation file to a UTF-8, the problem is resolved. In the solution also found a strange phenomenon, I opened with editplus, with another UTF-8 to overwrite the original file, and then re-open found that encoding has not been changed, I do not know whether it is the editplus bug or my version is incorrect. I am using Chinese.
Summary: In. net, it is best to use UTF-8 to encode the configuration file.