Unable to restore database when import .bak file - ssms-2017

I'm trying to perform a database restore but display the message as follows.
enter image description here
Can anyone help me with this problem? Thank you very much.
On SQL Server Management Studio 2017
Right click Databases on left pane (Object Explorer)
Click Restore Database...
Choose Device, click ... to display Select Backup Devices box,
then click the Add button to select add .bak file
But display the message as follows.
enter image description here

Related

pgAdmin import/export data greyed out

enter image description here
import/export data options are greyed out. How do i get them back

pgAdmin4 import/export option greyed out

so I recently configured and started using Pgadmin 4, managed to set up my localhost database, and my querys work properly, but for some reason I can't use the import/export dialog when I want to export my data as CSV, as it shows as greyed out. Could anyone help me out please? Image for Reference.
EDIT: The "Download as CSV (F8)" button is not working either.
You can just right click the table and use Import/Export option.
OR
To make Import/Export option you need to select table then click on Tools => Import/Export
And CSV download button is not working on some platform in current version that's a bug and already reported, It'll be fixed in next release.
if you are looking to export the query results , you need to do copy
COPY ([Query]) TO '[File Name]' DELIMITER ',' CSV HEADER;
Make sure you have created the file and it has all permissions to access

Add SQL command to report

I want to make a Crystal Report based on a SQL statement. I've read to do that, you add a command to the report, and to do that you have to connect to a database.
When I click the browse button I get the following screen:
Based on my research, it seems you connect to a database. As seen above, all of the file types are .xml files and all that shows up is Dataset. After I click on that, and right click on the dataset name node, the Add Command to Report is greyed out:
Normally you'd be able to add a custom SQL command by right clicking Add Command and selecting Add Command to Report However ADO.NET requires some unique steps in order to add the custom SQL. Instead you'll want to navigate here:
Create New Connection → OLE DB (ADO) → Microsoft OLE DB Provider for SQL Server
You'll of course supply the server information and pick the database.
After adding the connection:
1) Click the plus sign next to your connection.
2) Double-click the "Add Command" node.
3) Type in your SQL query, click ok.
Source: Crystal Reports 2016 Online Help chm file.
HTH,
aEon'

Make Model from Database using ADO.NET Entity Framework

I have a database and I want to make a model from it then later controllers and views.
I went to "Models" folder then clicked on "Add New Item" but unable to find Entity Data Model.
However Entity Framework 5 is already installed and reference is also present and I am using visual studio 2013 ultimate. I also tried nuget package manager but it is also confirming that Entity Framework is already installed. I think I am missing some thing or doing somthing wrong.
Please help me how to generate a model from a database.
I uninstalled the visual studio and then installed it again. It solved my problem.
Some components like visual studio database tools were not installed correctly. And it would also work if I would choose the repair option.
You'll need to creat an edmx file which captures your model from the database. the steps to do this are as follows:
To create an .edmx file from an existing database
Open or create the project for which you want to create an .edmx file.
Right-click the project name in Solution Explorer, point to Add, and then click New Item.
Select ADO.NET Entity Data Model in the Templates pane.
Enter the name for the file (.edmx), and then click Add.
The first page of the Entity Data Model Wizard appears.
Select Generate from database in the Choose Model Contents dialog box, and then click Next.
Click the New Connection button.
The Connection Properties dialog box appears.
Enter the server name, select the authentication method, and enter the name of the database for which the model is being created. Click OK.
The Choose Your Data Connections dialog box is updated with the database connection settings.
Click Next to continue.
The Choose Your Database Objects dialog box appears. By default, no objects in the database are selected for inclusion in the .edmx file.
Expand the nodes for Tables, Views, and Stored Procedures. Cancel the selection of any tables, views, and stored procedures that you do not want included in the .edmx file.
Click Finish to create the .edmx file.
this can be referenced more fully at: http://msdn.microsoft.com/en-us/library/vstudio/cc716703%28v=vs.100%29.aspx
[edit] - this is how the new item dialog should look:
Then when creating controllers/views, you just point to the required model in the select list, i.e:

Reporting Services Deployment Problem Deploying from VS 2005 to RS 2008

I've got a report that works perfectly in development previews. But when I deploy I get the following error:
In the Dev Environment the Error displayed is:
Error 4 The data source 'myDataSource'
cannot be found. c:\reporting services
projects\reports\rest_of_path\my_report.rdl
0 0
On the reporting services side the error it shows is:
The data source connection information
has been deleted.
(rsInvalidDataSourceReference)
By itself the datasource deploys just fine and it's present on the server so it doesn't make sense that it "can't find" it. What is going on?
P.s. I found a way to make it work on the server by manually assigning the datasource link that's lost in deployment. But I'd rather not have to do this every time I deploy a new report.
go to Report Manager(http:///reports/pages/Folder.aspx)
Click on the Folder in which u have reports
U will be directed into contents tab where u will find Show Details at the right top corner
Click on Show Details
Check in the particular report and click the edit button corresponding to it
Go to the properties tab and click on it
U will find a menu on left hand side, click on Data Sources link
There u will find radio button selected for A share data source(by default) and a browse button.
Click on the browse button u will find the tree structure of the datasource and the reports folder.
select the datasource in the datasource folder and select OK.
(From a post on http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/622dc981-4378-4331-b2fc-e377660464df/)
Did you upgrade the report files? the RDL spec changed between 2005 and 2008, you need to ensure that you are working with 2008 compatible tools if you are targeting 2008.
I got this to work with 2005, and to make it work I had to change the data source to use OLE DB and Sql Server Native Client 10.0. Another strange quirk was that the data source had to not have spaces in the name. I then had to reassign the report to use the new data source without spaces and then the 2005 rdl worked on the 2008 server.