New Install :System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','.

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
2/14/2013 12:23:41 PM
Gravatar
Total Posts 57

New Install :System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','.

Hello

I am trying to install new version of Mojoportal 2.3.9.5 as a new installation and I get the following error during setup procedure:

Probing system...
File system permissions ok.
MSSQL database connection ok.
database permissions are sufficient to alter schema.
database initial schema needs to be created.
Running script mojoportal-core - 2.3.4.8 - 00:00:00.1720098
System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at mojoPortal.Data.SqlHelper.ExecuteNonQuery(SqlTransaction transaction, CommandType commandType, String commandText, Int32 commandTimeout, SqlParameter[] commandParameters) at mojoPortal.Data.SqlHelper.ExecuteNonQuery(SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter[] commandParameters) at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(String script, String overrideConnectionInfo) at mojoPortal.Data.DBPortal.DatabaseHelperRunScript(FileInfo scriptFile, String overrideConnectionInfo) at mojoPortal.Business.DatabaseHelper.RunScript(Guid applicationId, FileInfo scriptFile, String overrideConnectionInfo) ClientConnectionId:d9b7b217-ff19-494b-86c7-953da3165f9f - 00:00:02.4741415
Note: This page shows some information that is helpful during setup and upgrades but for security it would be best not to show any information when the system is up to date. You can disable setup and suppress all information on this page by setting DisableSetup=true in Web.config. When you need to upgrade, you can set this back to false. If you are logged in as Administrator setup will run and you will be able to see this page even if it is disabled in Web.config so you can easily leave it disabled and just login before upgrading. But if you are not logged in you will need to enable setup in Web.config.

 

I am using VS2012 + SQL2005SP4 + Win7

Any help would be appreciated.

Thank you

2/14/2013 12:48:50 PM
Gravatar
Total Posts 18439

Re: New Install :System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','.

Please update your profile on this site with a  correct email address. I just tried to send you an updated script to see if it solves the problem and it bounced as undeliverable.

2/14/2013 1:14:48 PM
Gravatar
Total Posts 57

Re: New Install :System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','.

My apologies Joe,

I have updated my profile.Thank you

2/14/2013 2:28:43 PM
Gravatar
Total Posts 57

Re: New Install :System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','.

Hello Joe,

I just recieved your script file and it works fine now.

Thank you for your fast response.

 

4/5/2013 9:32:35 AM
Gravatar
Total Posts 1

Re: New Install :System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','.

I am getting the same issue to and need assistance ASAP. I tried to change the web.config with no avail. Here is the information i am using 

 <add key="MSSQLConnectionString" value="Data Source=mojouser11721.db.10378170.hostedresource.com; Initial Catalog=mojouser11721; User ID=mojouser11721; Password='iFvg5%Qg22x';"

<!--add key="MSSQLConnectionString" value="server=;UID=mojouser11721;PWD=iFvg5%Qg22x;database=mojoportal11721"/>-->
 

the one on the top was given tome by Godaddy the hosting provider and the commented one was one that i was playing around with

your assistance will be greatly accepted 

 

and this is the actual error from the page 

Welcome to mojoPortal Setup

Probing system...
File system permissions ok.
The system cannot connect to the MSSQL database. Please check your connection string.
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at mojoPortal.Data.DBPortal.DatabaseHelperGetConnectionError(String overrideConnectionInfo)
This site appears to be running in a secured environment using Medium Trust policy or at least lower than Full Trust.



Note: This page shows some information that is helpful during setup and upgrades but for security it would be best not to show any information when the system is up to date. You can disable setup and suppress all information on this page by setting DisableSetup=true in Web.config. When you need to upgrade, you can set this back to false. If you are logged in as Administrator setup will run and you will be able to see this page even if it is disabled in Web.config so you can easily leave it disabled and just login before upgrading. But if you are not logged in you will need to enable setup in Web.config.

4/5/2013 10:04:22 AM
Gravatar
Total Posts 18439

Re: New Install :System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','.

If user.config file exists in the root it will use the connection string setting from there instead of web.config. If user.config does not exist you should create it by renaming user.config.sample (which does exist) as user.config, then put your connection string there instead of web.config. This way you won't lose custom settings such as connection string when you later upgrade to a new version of mojoPortal.

If you still get this error after putting the connection string in user.config then you should ask your host for help because the error indicates that the web server cannot connect to the database server.

You should not post your database connection credentials in a public forum as it could be used by others to connect to your database, so I hope what you posted is not exactly correct. If you did I would suggest see about deleting that database user and creating a new one.

I would suggest format your connection string like this:

<add key="MSSQLConnectionString" value="yourserver;UID=youruser;PWD=yourpassword;database=yourdbname" />

Note that you posted single quotes around the password, you should not have those single quotes.

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.