Error SQL70001: This statement is not recognized in this context

Today, I got this weird error on my SQL script in Visual Studio 2017, where in it was highlighting various SQL statements when I copied the SQL file and added it to the project. Below is the exact error in Visual Studio 2017.

Error SQL70001: This statement is not recognized in this context.

However, the solution is simple. Select the file in the solution explorer, click F4 and change the Build option in properties window to none instead of build.

Advertisements

Install Office Web App Server 2013 on Windows Server 2012 R2

Let me give you a brief about what Office Web App Server is for those who don’t know what it is used for. Its basically a server which provides the Office Services to edit or view the office documents in the browser itself without the need of office installed on local machine of end users.

Installing OWA Server on Windows Server is not a pain until its Windows Server 2012 R2. Normally one would think like SharePoint it would give the list of pre-requisites which would be installed automatically but it doesn’t do that.

Continue reading

Call a JavaScript method/code from Asp.Net Code behind

In day to day development, we face a requirement that we need to call a JavaScript method or some lines of JavaScript code from code behind. There are several ways to accomplish this.

  1. Using ScriptManager Class.
  2. Using Page.RegisterClientScriptBlock or Page.RegisterStartupScript or Page.ClientScript object

Page.RegisterClientScriptBlock or Page.RegisterStartupScript methods are deprecated methods and they shouldn’t be used. Microsoft has replaced them with Page.ClientScript object methods.

ScriptManager class can also be used to do the same but with the slight difference, these methods are compatible with Asp.Net AJAX partial post backs where as the Page.ClientScript object methods are not compatible with Asp.Net AJAX.

Continue reading