Not able to change Connection String in SSIS DTSX package - asp.net

I have 2 SSIS(DTSX) packages which is existing one made in SQL Server 2008,
Now I Have to migrate into SQL server 2012 But I am getting problem in changing connection string .
When I open in the Designer mode using SQL Server Data Tools. Previously it was pointing to another Remote Server Now I am not able to change the new server,
I am using the Provider as-Native OLEDB/Microsoft OLE DB Provider for SQL Server,
Server Name when I am giving automatically it's not coming in the dropdown list and when I check Test Connection it is giving Test Connection Succeeded but when I click Ok it is not changing?
Can anyone please help me on this to Resolve this problem
Thanks in advance

The connection might be being set by an expression. Check the expressions for that connection - you may have to change the expression that is being used to set the connection.

Related

ASP.NET 4.5 Connection string to SQL Server 2019 - "An error occurred while communicating with the database"

So my company has an old legacy .NET 4.5 web application running on IIS (version 8.5.9600.16384) in which it's application database resides on Microsoft SQL Server 2014 (SP3)... This works perfectly fine.
However (due to decommissioning / upgrades) we want to move the database to our SQL Server 2019 Server. So I took the original .NET package and re-imported it >> during the wizard I entered the SQL Server 2019 Server / db path and renamed the solution name with '_TEST' suffix >> then restarted IIS. The resulting connection string looks like this (as expected / mirroring the original working one however with the new server / db / uname):
connection string in IIS
When I go to test logging in to the web application (via IE11), I get the following "an error occurred while communicating with the database" error after clicking login:
Error message
We also tested the same exact SQL Server 2019 connection string through Powershell on this same web server and we are able to connect into the database, so it would seem that there's some mechanism failing inside the .NET application whether there's a configuration or driver not quite right somewhere.
Does anyone have any suggestions as to what I could potentially try next or what the issue might be here?
It seems you need to use the correct connectionstring. I know it works in your previous sql server 2014. Please follow the below steps to get the connection string, and replace it in your web.config. And the settings sync to your IIS.
If there also have any errors, you can update your post.
Steps
open your vs2019, and open sql server object explorer .
Add new server, and type the information to connect your sql server 2019.
After connect to the sql server, please click the Properties to copy the Connection string.

Classic ASP connecting to localdb for SQL Server

Can anyone explain why this works
Conn.Open "Provider=SQLOLEDB;Server=tcp:myazurename.database.windows.net;Database=People;Uid=MyUid;Pwd=MyPwd;Encrypt=yes;"
and this doesn't
Conn.Open "Provider=SQLOLEDB;Server=(localdb)\v11.0;Database=People;Uid=MyUid;Pwd=MyPwd;Encrypt=yes;"
I copied my live azure database locally for dev work in Classic ASP and the error message is
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).] SQL Server does not exist or access denied.
Azure SQL server version: 11.0.9231
Local SQL server version: 11.0.2318
I can connect using the same details on SQL Server Management Studio so its not a user permissions thing...
Under Security for the server, the user has public server role, the user mapping for the 'People' database is everything except db_denydatareader and db_denydatawriter.
I have also tried (localdb)\\v11.0 which doesn't make a difference.
Any ideas?
OK so I believe the answer is as follows: It doesn't like (LocalDb)\V11.0 it wants a proper instance name like you said in the first place. MACHINENAME\INSTANCENAME OR localhost\INSTANCENAME which I am using as this is going to be replicated for other devs. Also, you DONT NEED two back slashes! My problem is I somehow didn't have a local instance installed. Thanks or your help #Lankymart

Timeout expired error in ASP.NET but not on SQL Server Studio

In my ASP.NET application, I am getting the following error:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
But I can successfully connect to the database server using 'SQL Server Mangement Studio' and I can also correctly PING the host where SQL Server is hosted.
What can be wrong here.
Check your connection string in web.config. The connection string you are using via SQL Management Studio is different to the one in the web.config.
You can increase timeout in web.config too which is better or say best approach.
Also whenever you get this type of error and everything is good in confirable, then first debug the code,
if the issue code side, then you manage simply by changing logic.
If it is sqlserver side, then get the parameter value and sp or query. Run in to SSMS which gives you better idea.
Increasing Command timeout to 120 fixed my problem for me.
adapter.SelectCommandCommandTimeout=120;

what's the issue with AttachDbFilename

Apparently, using AttachDbFilename and user instance in your connection string is a bad way to connect to a DB. I'm using SQL server express on my local machine and it all seems to work fine. But what's the proper way to connect to SQL server then?
Thanks for your explanation.
Using User Instance means that SQL Server is creating a special copy of that database file for use by your program. If you have two different programs using that same connection string, they get two entirely different copies of the database. This leads to a lot of confusion, as people will test updating data with their program, then connect to a different copy of their database in Management Studio, and complain that their update isn't working. This sends them through a flawed series of wild goose chase steps trying to troubleshoot the wrong problem.
This article goes into more depth about how to use this feature, but heed the very first note: the User Instance feature has been deprecated. In SQL Server 2012, the preferred alternatives are (in this order, IMHO):
Create or attach your database to a real instance of SQL Server. Your connection string will then just need to specify the instance name, the database name, and credentials. There will be no mixup as Management Studio, Visual Studio and your program(s) will all be connecting to a single copy of the database.
Use a container for local development. Here's a great starter video by Anna Hoffman and Anthony Nocentino, and I have some other resources here, here, and here. If you're on an M1 Mac, you won't be able to use a full-blown SQL Server instance, but you can use Azure SQL Edge if you can get by with most SQL Server functionality (the omissions are enumerated here).
Use SqlLocalDb for local development. I believe I pointed you to this article yesterday: "Getting Started with SQL Server 2012 Express LocalDB."
Use SQL Server Compact. I like this option the least because the functionality and syntax is not the same - so it's not necessarily going to provide you with all the functionality you're ultimately going to want to deploy. Compact Edition is also deprecated, so there's that.
Of course if you are using a version < SQL Server 2012, SqlLocalDb is not an option - so you should be creating a real database and using that consistently. I only mention the Compact option for completeness - I think that can be almost as bad an idea as using AttachDbFileName.
EDIT: I've blogged about this here:
Bad Habits : Using AttachDBFileName
In case someone had the problem.
When attaching the database with a connection string containing AttachDBFile
with SQLEXPRESS, I noticed this connection was exclusive to the ASP.NET application that was using the database. The connection did block the access to all other processes on the file level when made with System.Data.SqlClient as provider.
In order to assure the connection to be shareable with other processes
instead use DataBase to specify the database name in your connection string
Example or connection string :
Data Source=.\SQLEXPRESS;DataBase=PlaCliGen;User ID=XXX;password=ZZZ; Connect Timeout=30
,where PlaCliGen is the name (or logical name) by which SQLEXPRESS server knows the database.
By connecting to the data base with AttachDBFile giving the path to the .mdf file
(namely : replacing DataBase = PlacliGen by AttachDBFile = c:\vs\placligen\app_data\placligen.mdf) the File was connected exclusively and no other process could connect to the database.

What connection string do I use for Classic ASP and Oracle 10g?

I have Oracle 10g and have installed ODBC via the instant client. I am able to use the ODBC administrator and set up a DSN and test successfully, and whenever I use Microsoft Access I can connect to my database no problem. I can also use Visual Web Developer to traverse the data.
But, when I try and use Classic ASP with:
myConn.Open "DSN=oracle10g;" & _
"Uid=myOracleUsername;" & "Pwd=myOraclePassword"
I get:
-2147467259Specified driver could not be loaded due to system error 5 (Oracle in instantclient10_2).
An error occurred while trying to create Server Object.
I have searched various places but nothing seems to work. All ORACLE_HOME, TNSnames, IUSR_X security, all is correct. I am thinking it is a DSN connection string problem.
Anyone know?
Try using the following DSN-less connection string:
myConn.Open "Provider=MSDAORA;Data Source=instance_name;User ID=myOracleUsername;Password=myOraclePassword"
I've used this exact connection string for older version of Oracle client, but can't see any reason why it won't work for your version as well.
try this :
provider=OraOLEDB.Oracle

Resources