Visual Studio 2008 Question, table adapters connections string issue - visual-studio

I have a data source that I use for creating reports in my programme. I've recently changed the connection string to the table adapters created by the wizard(ConString1), because I wanted to make that connection string available to every other class that needs to use it. So basically. I deleted the application setting created by the wizard(ConString1) and entered in my own application setting(ConString). Once debugging began all the code that still refered to the now non existent connection string(ConString1), I changed to the available one(ConString). That is in the code the debugger picked up. The program works fine.
Now my problem is this, when I select a table adapter and take a look at its properties, the Connection string is still set to the old connection string name, the connection string value itself is given as "Unable to find connection ". This is prohibiting me from adding new tables to my reports.xsd file.
I also keep getting an error when trying to create a new datasource.
Error : Could not load type Microsoft.VisualStudio.DataDesign.SyncDesigner.SyncFacade.SyncManager.

Right-click on the data-set xsd, select "Open With..."
Select "XML (Text) Editor" and click OK.
Modify as needed, and be careful.
Be careful.

Related

Visual studio xsd set connection string to None

I want to set connection string for my DataSet to None, because i use string that i build in run time. So i do not want keep fake string in app.config, just tome make xsd compile. Is there any way to achieve this?
If i set None in designer its still turn it to existing connection string from config.
I use visual studio 2017.
The best way I've found to have the benefits of the XSD designer and be able to change the connection settings for staging and production is as follows: - NOTE: this works in VS 2012 ... think it should also in 2010 - Also, DataSets were created by dragging from the Server Explorer, which saves connection information in the class library app.config and Properties.Settings.settings which is used at design time.
1) For each DataTable, click on the TableAdapter header (below the attributes and above the methods) and look at the properties 2) Change the Connection Modifier to Public 3) Then, the code to access the table should be something like the following (where the class library is named DALib) ...
using DALib;
using System.Web.Configuration;
PriceData.averageSalePriceFDataTable priceTable;
DALib.PriceDataTableAdapters.averageSalePriceFTableAdapter priceAdapter
= new DALib.PriceDataTableAdapters.averageSalePriceFTableAdapter();
priceAdapter.Connection.ConnectionString
= WebConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString;
priceTable = priceAdapter.GetData( ... parameters ...);
This uses the connection string in the class library for design and picks it from Web.config when running.
Hope I understood your problem correctly, let me know.

How to remove SSRS credentials in Visual Studio 2008

I have a question similar to this one, but I am using VS 2008 and an Oracle database (with Oracle SQL Developer). How do I get rid of the report credentials in VS? Thank you.
One of the easiest ways to get rid of this is to supply a username and password for the database in question on the reporting server. The URL is usually something like http://localhost/reports. Usually, users created for this type of connection have minimal read-only rights needed for the specific report. The disadvantages to this type of connection is that it's a one-user-fits-all situation. But because of the error message you are getting, it appears that your wish is to supply a specific user name and password rather than use Windows security--which is just fine.
To get here, click Security from the report drop-down list on the main page. Then, click the Credentials stored securely on the report server. Then, here's an issue that get's lots of folks--click the Apply button at the bottom to save the changes. Sometimes the Apply button is not visible and you need to scroll down to click it.
Now, if you're accessing your report through ReportViewer in VS then the following link may provide some help:
http://www.sql-server-performance.com/2012/accessing-ssrs-reports-report-viewer-web-page/
Alternately, you can create or add to a web.config file:
https://msdn.microsoft.com/en-us/library/microsoft.reporting.webforms.ireportservercredentials.aspx
p.s. based on our chat, try adding the following to your web.config connection string--if you have one(with the respective user name and password)--if, indeed you're using Oracle's ODP.net:
providerName="Oracle.ManagedDataAccess.Client" connectionString="User Id=oracle_user;Password=oracle_user_password
http://www.oracle.com/technetwork/topics/dotnet/downloads/odpnet-managed-nuget-121021-2405792.txt
I have not figure out how to solve this from the database. What I did was, comment out this line of code from the XML of the report:
<Prompt>Specify a user name and password for data source XXX</Prompt>
If you have the correct credential info in the <value> tag, your report should be loaded with username and password parameters without problems.

Crystal Reports Data Source in Oracle

I inherited a legacy system using Crystal Reports in VS.NET pulling info from an Oracle11g DB.
The database fields are in "REPORT_DATA", I updated the stored procedure which the code is querying to add a field, however I cannot see that new field in the field explorer.
When I click on "Verify Database" and manage to log into the DB I get a "Remove Table" prompt - "The database table "REPORT_DATA" cannot be found. Proceed to remove this table from the report?"
Of course, there is no REPORT_DATA table and there never was.
When I preview the report or put it on the server it works, so there is some behind-the-scenes magic which I don't understand.
Figured it out.
I had to highlight the server name in the “Current Data Source” area and the name of the server in the “Replace With” area on the Set Datasource Location window. Then click the “Update” button.
Since the report wasn't built on my machine it had to be reconfigured - can't figure out why it still connected to the DB when previewing though.

Cannot create an ADO.NET entity data model through wizard

I have an issue and I cannot find out what the problem is. In visual studio 2010 I'm trying to add a new ADO.NET entity data model through the wizard (I'm using Entity Framework 4.1). After the second wizard step (that says "Choose your Data Connection") I press next and the wizard is closed right away, and there are no following steps at all. Here is my entity connection string:
metadata=res://*/DAL.Model1.csdl|res://*/DAL.Model1.ssdl|res://*/DAL.Model1.msl;provider=System.Data.SqlClient;provider connection string="Data Source=DMITRIY-TOSH\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True"
Is there anything wrong with that connection string? What should I change in it and how? Or what else can be the cause of the problem? Help me with this, please. I don't even know how to make it work to see the next wizard step where I can choose tables.
Found the solution. The folder "App_Data" (with the database inside) wasn't included into the project. Only because of that the wizard did not work.
I had this problem too, all the above didn't work for me. What helped for me was the following.
When you try to connect with a database that database can have different users with different credentials it can accept. Let's say user A till D.
If you try to connect with a user make sure that user has the right credentials enabled, in this case, read and write options enabled.
To do this start MS SQL Server Managment Studio, connected with your SQL server and select the database you try to make a connection with in visual studio. Under 'your_dbname' --> Security --> Users you find a list of users. Rightclick the username you try to login with and select properties. A window opens. Select the 'General' (selected by default) page and under tab 'Database role membership' make sure 'db_datareader' and 'db_datawrite' are selected.
Note: When you log in too MS SQL Server Managment Studio make sure you log in with a user which can enable/disable these options...
I created an empty model, then selected it in 'Model browser', right clicked on it and selected 'Update model from database'. Then I was able to add a table to it...

Change the connection string in app.config with InstallShield 2011 setup

I'm creating an InstallShield 2011 basic MSI installer project.
I'm trying to change the connection string in my app.config according to the user selections from the database login dialog made in the setup. How can I apply these connection string settings to the connection string entry in the app.config of my windows application I'm trying to install?
XML File Change is the right place to start from. Since changing the connection string is a common task my hope was that there is a best practice to do exactly this task.
-- edit --
There are two main difficulties:
How do I reference a file in InstallShield which will be created on build? The App.config gets copied to MyAppName.config. I don't want to hardwire the application name into the setup at this place again.
The connection string in the config file is used by Entity framework, thus contains more information than given by the database selection from InstallShield. I have to patch an attribute within an element of the config file, if I just want to change the Server and InitialCatalog properties of the connection string. It looks like XML File Change only supports replacing of an entire element or attribute.
As far as I remember, the XML File Changes is designed for this purpose. You can place the user's choice as a property value when defining your XPath and element/attribute values. For me, it was one of the areas of InstallShield which worked quite good and as described.

Resources