JSON Connection string configuration - sql

In the app settings JSON file I am passing through a connection string which contains the name of my server
' .\SQL2017 '
I recieve the following warning in error list when entering the server name verbaitam as so in the connection string
'Invalid escape sequence'
When I then run the 'dotnet ef database update' command in the terminal I get the error
An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: Could not parse the JSON file.
When I take away the .\ from the connection string to remove the warning for 'Invalid escape sequence I get passed the error above and am then faced with the error
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 conf
igured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I am sure that the rest of my connection string properties are correctly entered with no warnings but I am not sure how to format the server name in the connection string in a JSON format so that it can accept without any errors

Double the backslash to escape it:
.\\SQL2017

Related

Error "Could not load connection type oracle URI has an authority component " when trying to add new connection in SQL Developer

When I try to add a new connection in Sql developer its throwing an error "Could not load connection type oracle URI has an authority component" Screenshot 1
After clicking on OK on the error prompt, it opens the add new connections window but the TNS entry section is not available. Screenshot 2
When I go to Preferences->Database->Advanced to check whether the TNS path is correct or not, I see the exception there also.Screenshot 3
I am using SQL Developer v18.4 and Oracle 12c
'Install' SQL Developer to a directory on your machine that's not a UNC path, like put it in c:\sqldev or /users/home/jeff/sqldev

Connection string parameter cannot be null

I have an MVC Core application that works on my machine, where SQLEXPRESS is not a named instance. When I deploy it to IIS 7.5 on a remote machine, where it is a named instance, without changing the connection string:
"Server=localhost;Database=QuickShare;Trusted_Connection=True;MultipleActiveResultSets=true"
I get the following error:
SqlException: 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: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server)
Then I correct the connection string for the nameD instance:
"Server=localhost.\SQLEXPRESS;Database=QuickShare;Trusted_Connection=True;MultipleActiveResultSets=true"
I get the following error:
ArgumentNullException: Value cannot be null. Parameter name:
connectionString
In the stack trace on the developer error page, highlighted is the following line from Startup.cs:
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
How does changing only the connection string go from an expected connection exception to a null parameter exception?
Remeber that your configuration file is JSON which means certain characters need to be escaped, in this case it's the backslash. So from this answer you can see that you need to double up the backslash. For example:
"Server=localhost\\SQLEXPRESS;Database=QuickShare;......"

Error connecting to MS SQL SERVER in Pentaho

I m using Pentaho v5.2. When i tried to connect to sql server i m end with below error. I had downloaded and placed required driver sqljdbc4-2.0 jar in pdi-ce-5.2.0.0-209\data-integration\lib. Please help me as I'm new to Pentaho.
Error connecting to database [mssqlserverconn] : org.pentaho.di.core.exception.KettleDatabaseException:
Error occured while trying to connect to the database
Error connecting to database: (using class com.microsoft.sqlserver.jdbc.SQLServerDriver)
Login failed for user 'Lenovo-PC\RamaKrishna'.
org.pentaho.di.core.exception.KettleDatabaseException:
Error occured while trying to connect to the database
Error connecting to database: (using class com.microsoft.sqlserver.jdbc.SQLServerDriver)
Login failed for user 'Lenovo-PC\RamaKrishna'.
From the error message you're being thrown, it's an authentication issue.
It looks like you are trying to use your username from your laptop domain - is that what you want? Does the the server accept this user name (Lenovo-PC\RamaKrishna)?
You may have been using integrated security, which basically overrides whatever you set as the username in the text-box and uses your Windows username instead.
See below:

Error in BeginStartup CollaborationPlatform using ProvisionedApplicationPlatformSettings

I am trying to create an ApplicationEndpoint by first creating and establishing the CollaborationPlatform using ProvisionedApplicationPlatformSettings, when i execute:
ProvisionedApplicationPlatformSettings settings = new ProvisionedApplicationPlatformSettings("MYAPP", _appID);
_collabPlatform = new CollaborationPlatform(settings);
_collabPlatform.BeginStartup(EndPlatformStartup, _collabPlatform);
in EndPlatformStartup method while executing collabPlatform.EndStartup(ar); i get an error
ProvisioningFailureException:
One or more values in the configured settings are invalid or unusable. Check inner exception and logs for more details.
The settings wrapper failed to initialize.
Unable to find the Sqld database: 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)
Found the Answer/Error,
i was trying to run the application from Windows 7 PC which apparently is not supported for Auto Provisioned Application , so now i build the application on my Win7 PC and then execute it on the Lync Server.

how to remove security settings from a connection string in vb.net

hi i am trying to add data to the database that was created by some one but when am trying to insert or delete or update the exception is raising and entire project is not working properly and the error i am facing is
"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)"
so now what should i do to resolve this error and my connection string is written as
Dim CON As New SqlConnection("Integrated Security=SSPI;
Persist Security Info=False;Initial Catalog=DIGITALGAMES;
Data Source=TEJUS-PC\SQLEXPRESS")
is there any problem with my connection string ??
This error usually comes when database path is wrong i.e. system is enabe to locate the database
plz make apropriate modifications in
Data Source=TEJUS-PC\SQLEXPRESS
Dim CON As New SqlConnection("Integrated Security=SSPI;
Initial Catalog=DIGITALGAMES;Data Source=TEJUS-PC\SQLEXPRESS; User ID=yourusername; Password=yourpassword")
and
try this link
, with useful information about connection string
I think the server you are trying to access is either not in the network or you dont have windows authentication to that server.