Entity Data Model Wizard can't find my Connection - visual-studio

In VS 2019, I created a connection in Server Explorer. The connection is for Oracle and it passed the Test and was created successfully. However, when I go to create an ADO.NET Entity Data Model, on the screen which asks "Which data connection should your application use to connect to the database?" and has a combo box immediately below that question, there are no connections from which to choose. Why doesn't my connection show up there? I even restarted Visual Studio with no difference.

Related

How can I run my project on client pc without installing SQL server on client pc

I have developed a c# windows application which uses SQL server 2012 database in Visual Studio 2015 which is running well on my pc.
I am to install this application on a number of computers without SQL server installed on it, but when I run the application, its gives me database connection error.
My question is, how can I create the setup file to be able to run the app on those clients pc without installing SQL server on all those computers. Please I need your help.
Thank you.
Am Emmanuel.
Use an Azure database and have the clients connect to that.
Have a look at https://azure.microsoft.com/en-us/services/sql-database/
Alter your application connection string and make sure you keep the connection string secret.
Server=tcp:myserver.database.windows.net,1433;Database=myDataBase;User ID=mylogin#myserver;Password=myPassword;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True;
An important fact is that the clients need to allow communication via port 1433.
If this is not an option create an API application and query the database via that.
If you need a private database per client you can use a database file and connect to the file
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-express-localdb?view=sql-server-ver15
Update based on reply
You can create a pop-up on the application allowing the users to add valid settings and credentials when your appsettings.json is blank or "a test connect" to the database fails.

SSIS - Oracle view not visible to import

I am new to SSIS. I do not have access to oracle DB. Oracle team has created a view and granted access to that view to a user which we are using to connect to DB through SSIS.
When I create a new ADO.NET connection and click on test connection ,it says connection is successful and when i try to retrieve the "tables or views" pop up box comes to enter password again and it throws error.Error : "Could not retrieve the table information for the connection manager.Object reference not set to an instance of an object"
Where as If i use the existing connection with same credentials it is working.What can be the possible reasons ?
However I used the existing connection and When I look for the view which is to be used as source, That view is not available.When I reached out to Oracle DB team who has created view , they say that the view exists and permission is granted to the user .They logged in to oracle using the same user and the user has access to the views.Now I am not sure that why is it not available to the user when I connect it through SSIS. I am using visual studio 2017
At first, you have to pick ".Net Providers\OracleClient Data Provider" from the Provider list in Connection manager for ADO.NET. Second, You should enter the name of your Oracle DB or the IP of it (The name is better) for "Server name:" drop down. Third you should enter your user and password in the textboxes below the "Log on to the database". After all of these, you can click on "Test Connection" and everything goes right. now you can click "yes" to shut the window.
Now you can add one ADO.NET source in your data flow task, pick your connection in its "ADO.NET connection manager" drop down, and finally see the tables or views list in the "Name of the table or the view" drop down.

SQL Server Compact Database File

I have a SQL Server Compact Database file (.sdf) that I am trying to connect through using Visual Studio 2017. I have installed SQLight / SQL Server Compact ToolBox with NuGetPackage Manager.
I have placed a SqlDataSource on the ASPX page.
I click new "Connection" Select "SQL Server Compact 4.0 (Simple by ErikEJ)"
Put in the Data Source.
Test Connection "Test connection succeeded".
Click OK and I get this error
Exception of type 'Microsoft.VisualStudio.Web.Data.InternalException' was thrown
I have searched google can not find anything about this. I can connect to different SQL Server databases but not to this .sdf.
Any recommendations?
SqlDataSource does not work with SQL Server Compact (or vice versa). Use for example EF Core or ADO.NET for data access instead.

SSIS DB2 connection troubles in Visual studio 2015

I would like to ask question about connection managers OLE DB Provider. Accidentally i have two copies of OLE DB Provider (Copy1 and Copy2) on my computer. Copy2 is not registered on Server, but if i want to use Copy1 username and password is gray / non editable.
Why? In users DSN i have both – DB DB2COPY1 and DB2COPY2
How can i enable COPY1 to be edited (username and password) ?
Prints from Visual studio 2015
If I click on Data Links i see this error
Thanks
Answer found! :) maybe it will be helpful for someone. First copy was just IBM Server Client Version, Second copy was Server Runtime Client.
So i unistalled both, then install Server Runtime Client as First copy and it works

Connecting to database on web host in Visual Studio or Sql Server Management Studio

I have a web site developed locally with a local Sql Server database. I also have a web host that provides one Sql Server database for my site. Now I want to deploy the application, and I would like to be able to manage the remote database from the Server Explorer in Visual Studio. I have the connection string used in the application, which works fine for adding, say, a datasource to a control etc. But I don't know if there's any way to use it to connect the database inside the Server Explorer so that I can add tables etc. I have read that you're supposed to be able to this instead of using the Sql Server Management Studio, but I have'nt read anything about how to connect to the remote database in it.
What I have tried so far is this: I have selected Add database in Server Explorer. This brings up first a dialog where I choose Sql Server. And then I get a dialog where I can set Server name (which I tried using the ip address in the connection string below), and Authentication (where I chose Sql Server Authentication, with the user id and password from below). But when I test the connection it fails.
Here's the connection string, which works fine when used for datasources in the application (obviously with different user name and password):
Any help appreciated!
EDIT:
Well, I've done everything suggested by lewiguez below now, but it doesn't make any difference. I can't believe this should be so hard... I keep getting this error message in Sql Server Management Studio:
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) (Microsoft SQL Server, Error: 53)
Here's the process I follow for working with remote databases:
In VS 2008 under the Server
Explorer tab, right-click on "Data
Connections" and then click "Add
Connection"
Change the Data Source to
"Microsoft Sql Server"
Put in your fully-qualified
"Server Name" (be it IP Address, domain name, etc.), select "Sql Server
Authentication" and put in "User
Name" and "Password" for the database user
Select the database you want to connect to under "Select or enter a database name"
Hit "Test Connection" to test and then "OK" to accept
You should be able to interact with the database at this point by expanding the connection and then the "Tables" folder. For example, right-click on the Tables folder and you'll be presented with an "Add Table" option in the dialog. Right-clicking an existing table will bring up the "Open Table Definition" options where you can change any columns, etc.
If you're not getting to this point (and it sounds like you're not), I'd recommend checking your Sql Server connection from whatever machine you're using.
I generally do this by going into the Management Studio and connect with whatever credentials I'm trying to use. If they don't work, make sure they are, in fact, added as a Sql Server user and a database user (they have to be both).
Also, I would check in the Sql Server Surface Area Configuration Manager. You have to allow TCP connections and you have to be set up to allow Sql Server Authentication connections as well from remote hosts. If THAT'S all set up, but you still can't connect, I'd double-check to make sure your firewall is allowing Sql Server connections. The default port is 1433.
Also, if you can connect, but then can't write to anything, double-check your table permissions. Hope this helps!
I finally understood the problem: as I suspected the settings in my own installation was not the problem, but rather it was the settings on the Sql Server installation on my web host. And in fact I found a place in the control panel on my web host where I could set an exception to my ip address so that my ip would be granted access to the port 1433 for Sql Server, which is otherwise closed by default for security reasons.
I've had no luck finding any information about this at all on the internet, which I find strange. All the information I could find had to do with changing these settings on your own local installation of Sql Server. But I'm sure there are loads of people out there who like me use a web host for deploying their web site, and then that info doesn't seem to apply. (Perhaps apart from the TCP setting, which I think must be set, and there's detailed info about that here: http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/ )
Hope this helps someone else who like me uses a web host. Now everything works fine for me at least, both in Management Studio and in Visual Studio Server Explorer.

Resources