LightSwitch : Attach to Online Data Source - sql-server-express

Using Microsoft Visual Studio LightSwitch Beta 2
How to Attach to external Data Source that could be found on my Host ?
Example :
Host : www.xxxxx.com
Database : www.xxxxx.com/Source.mdf
How can I point SQL Server to there ?

In the Solution Explorer on the right, right-click Data Sources and choose "Add Data Source...". Then choose Database and Microsoft SQL Server.

Related

Unrecognized database format'C:\.....\Employees.accdb for Microsoft Access Database File?

I am trying to access a file stored in a Microsoft Access database. (I am working in Visual Studio 2012) I chose the Database source type, and the Dataset database model, when it asks me "which data connection should your application use to connect to the database?", I clicked New Connection, then I chose Microsoft Access Database File (OLE DB). Under the Database file name, I clicked browse and selected the appropriate file(Employees.accdb). When I press Test Connection or Ok I get this error: Unrecognized database format' C:.....\Employees.accdb. Any ideas as to what I am doing wrong?
Your computer is missing Microsoft.ACE.OLEDB.12.0
You can get it from here: http://www.microsoft.com/en-us/download/details.aspx?id=13255
I know this is a bit old but if anyone else has the same problem, this worked for me.
According to your description, I create a sample VB project and try connect to the Access 2016 database and I get the same result with you. Then I try to connect old version of Access database and it is successful.
I find the Provider that used to connect the old version is Microsoft.Jet.OLEDB.4.0. But for Access 2016 database, we should use Microsoft.ACE.OLEDB.12.0. So we need to install Microsoft Access Database Engine 2010 Redistributable and 2007 Office System Driver: Data Connectivity Components, which will help us install and register Microsoft.ACE.OLEDB.12.0 to our local machine.
Then please connect the Access 2016 database with following steps.
Add New Data Source --> database --> Dataset --> New Connection --> Microsoft Access Database File --> select the accdb file -> Click Advanced button to change the Provider. Then click the OK button back to the Add connection windows and Test connection, it will succeed.

Error 1813 attempting to attach .mdf to SQL Server

Running as admin.
Right click Databases -> Attach, click Add
Browse to directory containing .mdf files (NO FILES SHOWN)
Manually type in file name -> Click "OK" (Message: "Not Found")
Click OK
Failure (SQL Server, Error: 1813)
To the best of my knowledge, the files exist, the permissions are correct, and there has been no reason for corruption (unexpected power outage, hard disk failure, etc.)
Please assist with resolving this, so I can use my database again!
Thank you!
P.S.
Microsoft SQL Server Management Studio 11.0.2100.60
Microsoft Data Access Components (MDAC) 6.2.9200.16384
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 9.10.9200.16721
Microsoft .NET Framework 4.0.30319.18051
Operating System 6.2.9200
Credit to #NenadZivkovic for pointing me in the right direction.
The simple answer is that the user running the DB engine service did not have permission to access the folder.
The more complicated answer is that the permissions were FUBAR, and the actual permissions were not being displayed correctly in various locations.
I had a similar problem when attaching mdf file. I had to run as an administrator when opening the Mgt Studio, then extracted the mdf file...remove the log file...select the mdf file section and then click ok.
it is either persmissions of the data-folder where mdf-file is or mdf-file is in read only mode.

"This database file is not compatible with the current instance of SQL Server"

I am currently reading through a book about MVVM and I need to use the Northwind database for the next section. Unfortunately, when I try to add Northwind to my project, I get the following error:
"An error occurred while connecting to the database. The database might be unavailable. An exception of type 'Microsoft.Data.ConnectionUI.SqlDatabaseFileUpgradeRequiredException' occurred. The error message is: 'This database file is not compatible with the current instance of SQL Server.'"
I haven't installed an SQL Server, just Visual Studio 2012. The book instructs me to add the .MDF file to the project, set it as an Entity Data Model, and then to generate from database. It's on the next screen where I get the error. I use NORTHWND.MDF as the data connection and the entity connection string is as follows:
metadata=res:///Model1.csdl|res:///Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=(LocalDB)\v11.0;attachdbfilename=|DataDirectory|\NORTHWND.MDF;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"
In the book, this reads:
metadata=res:///Model1.csdl|res:///Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NORTHWND.MDF;Integrated Security=True;UserInstance=True"
I have tried using both data sources and neither work.
Also of note, the sample code that goes along with the book doesn't work either. It compiles and launches, but in the server explorer, NORTHWND.MDF has an 'x' in the icon and upon launch none of the data is there.
When I attempt to upgrade the database, I get an error saying:
"Database '...\NORTHWND.MDF' cannot be upgraded because its non-release version (539) is not supported by this version of SQL Server. You cannot open a database that is incompatible with this version of sqlservr.exe. You must re-create the database..."
If anybody could give me any tips on how to get this working, I would certainly appreciate it.
my simple way:
go to VisualStadio 2012
In Server Explorer Windows
open Data Connections
Right click on ASPNETDB.MDF
click on Modify Connection...
a new windows open for you ... you just click OK
if other windows open for you click Yes
FINISH ( be Happy ) :D
If we are trying to attach .mdf file in SQL Express mode in our development project and while adding .mdf file in App_Data folder we are getting exception like below :
"The database file is not compatible with the current instance of sql server...."
Then we can go to Server explorer window → go to Data connections → go to "your database" → right click on Modify connection → check the Data sources and Database file name, then use windows Authentication and press OK.
It works for me.
one way to potentially fix it is, install Sql Server 2012 Express and use database connection to sql server. Do not use local database. That might work. Just a suggestion.
Also as an extra note, you might want to download SQL Server 2012 Management Studio (I believe it comes with the above download as a component that you have select). With Management Studio Installed, you can test the database connectivity separately, create tables, run queries etc. This will make troubleshooting a lot easier.
Visual Studio doesn't install any database server by default so you can't connect to one. The MDF file is just the file where SQL Server stores its data, it's not a standalone database.
You have to install some version of SQL Server 2012 Express for both connection strings to work.
The first connection string uses the LocalDB feature which is essentially a minimal installation of SQL Server 2012 Exrpess (~ 35 ΜΒ). You can only connect to LocalDB from your machine which makes it useful only for development purposes.
The second connection string connects to an actual instance of SQL Server Express, called SQLExpress, installed on your local machine. The second connection string attaches the MDF file to the server as a User Instance, which means that the file is released when you stop using it.
The SQL Server Express downloads range from 130 MB to 1.3 GB depending on which version you download (minimal to full with advanced services).
Northwind database is not readily compatible with 2012, the compatible version of Northwind database for sql server 2012 can be downloaded from the below link, and after downloading .mdf file we can easily attach it with sql server 2012. I have found the following and it helped me, hope it will help you. How to Attach Northwind Database in Sql Server 2012
First go to data connection as on pic:1
2.Then browser your mdf file press ok and it will automatically convert the database.
picture:01
picture:02
Modify connection may solves the problem, but I am not sure whether the type of this database file is changed.
I have found a way to solve this problem if you have installed the database Server corresponding to the database file. You just need to change the default database Server of your visual studio.
On the menu, choose Tools-> Options -> Database tools, then on the data connections enter the SQL server Instance name corresponding to your database file which you have installed,then press Ok.
Next step is also important, it is necessary to click 'refresh' or delete the database filename in Data Connection and reopen the file, the file will be added to Data Connection again and open successfully.
This is what worked for me:
On the Add Connection dialog box, click Advanced.
Scroll down to the bottom and look for a field called Data Source.
Change it from (localdb)\MSSQLlocalDB to .\SQLEXPRESS.

I've deployed a database project to my local SQL Server Express - how do I see the database now?

I've created a "Database project" (.dbproj project file) in Visual Studio 2008, added a couple of tables there and selected "Build->Deploy". Visual Studio said it has successfully deployed my Database1.sql into (local)\SQLEXPRESS.
Now I'd like to see the database - be able to delete it or just see that it looks right - but I can't find where the database is and how to manipulate it without writing code. How can I get a hold on the newly created database?
You can use the SQL Server Management Studio stand alone application, or the Server Explorer in Visual Studio.
There are also a lot of tools from other vendors like Toad or SQuirreL...

Connecting BIDS to TFS2010 problem - dialog doesn't allow a path to be specified

I want to attach my BIDs (VS2008) to our Team Foundation Server 2010 to put the project artifacts under source control.
I've installed the Visual Studio 2008 SP1 Forward Compatibility Update for Team Foundation Server 2010 so I get the dialog to attach to the TFS server, but it only asks for the name of the server. When connecting via VS2010 I get the option to add the path as well as the server name which, evidently, is required to connect to our TFS server.
Is the URL/path saved to a solution or project file so I can hack it manually?
The secret is to type the full URL to the TFS project in the dialog box - it just seems to accept it without attempting to parse it.