Entity Framework doesn't create the database in SQL Server Management 2012, instead it just creates in (localdb)\v11.0 How to fix it?

Hi, I'm Begginer in Entity Framework. Then I'm having some problems.
I created my entities and I give Save Changes. (Ok)
Then, I Tried to Connect with the database through Server Explorer, if I use the instance of the SQL Server Management Studio 2012(PC-PAULO\INSTANCIAPJ) as Server Name, the database doesn't appears but, if I use the the instance (localdb)\v11.0 the dabase
appears.
How to change the save to the SQL Server Management Studio 2012, I don't know where this (localDB)\v11.0 saves.
Help-me Thank you :D

Hello PauloJos,
The code should be ok and it is really strange that the database is only created into the local database in your machine. I am wondering if it is related with the machine environment, could you please have a try with below demo on your machine which works
on my side and if it is possible, please have a try to run your application on other machines to see if it works:
class Program
static void Main(string[] args)
#region https://social.msdn.microsoft.com/Forums/en-US/00eff3c4-2336-4807-9212-e6f2a6c8812e/entity-framework-doesnt-create-the-database-in-sql-server-management-2012-instead-it-just-creates?forum=adodotnetentityframework
using (CFDbContext db = new CFDbContext())
db.Database.CreateIfNotExists();
#endregion
public class CFDbContext : DbContext
public CFDbContext() : base("UltraFoda3") { }
public DbSet<TestOne> TestOnes { get; set; }
public class TestOne
public int ID { get; set; }
public string Name { get; set; }
Config file is similar:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="UltraFoda3" connectionString="Data Source=YourServer;Initial Catalog=UltraFoda3;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How to create a database in Sql server management studio

    how to create a database in Sql server management studio

    One method is to run the SQL statement below from a SSMS query window:
    CREATE DATABASE MyDatabase;
    You can also right-click on the Databases node in SSMS Object explorer and select New Database.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • How to create a database in SQL Server Express 2014 to be used with LV Database Toolkit

    I use LV Database Toolkit, which by default uses Jet database. Now I want to use SQL database with LV Database Toolkit. I have downloaded and installed "SQL Server 2014 Express with Tools" in my Labview Laptop. Now I want to create a database in SQL Server, because I think it is a requirement for creating a "udl connection file" (*.udl file). Please help me!
    Solved!
    Go to Solution.

    I made a database whose path is: C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\depot1
    I tried to make .udl connection file, but when I click on "test connection" with the provider: "OLEDB Provider for Microsoft SQL Server" I get the Error "UDL Connection File Failure" (attached below)
    When I tried to make the .udl connection file with the provider "Microsoft SQL native Client 11.0" and when I click on "Test Connection" I get the Error" UDL Native Client_1"& " UDL Native Client_2".
    Please help!
    Thanks!
    Attachments:
    UDL Connection File Failure.png ‏78 KB
    UDL with Native Client_1.png ‏702 KB
    UDL with Native Client_2.png ‏714 KB

  • How to restore SQL Server 2008 database to SQL Server Express 2012

    How to restore SQL Server 2008 database to SQL Server Express 2012.
    I BACKED UP a SQL Server 2008 database from work, which runs the enterprise version of 2008, and I tried to RESTORE it to my new 64-Bit home PC which is running the new SQL Server Express 2012 64-Bit (Advanced Edition).
    But if fails. I get the following message text.
    Can anyone help me please. I thought restoring a 2008 database to the later version 2012 would be possible.
    Here is the error message. Thanks.
    TITLE: Microsoft SQL Server Management Studio
    Restore of database failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)
    ADDITIONAL INFORMATION:
    System.Data.SqlClient.SqlError: The database was backed up on a server running version 8.00.2039. That version is incompatible with this server, which is running version 11.00.3128. Either restore the database on a server that supports the backup, or use a
    backup that is compatible with this server. (Microsoft.SqlServer.SmoExtended)

    ADDITIONAL INFORMATION:
    System.Data.SqlClient.SqlError: The database was backed up on a server running version 8.00.2039. That version is incompatible with this server, which is running version 11.00.3128. Either restore the database on a server that supports the
    backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.SmoExtended)
    Are you sure your database is SQL server 2008 from error message it seems your SQL server version is 2000.I guess you have multiple versions of SQL server.
    AFAIK you cannot restore backup of SQL server 2000 to 2012 directly .Restore it first to SQL 2008/2008R2 or 2005 then take backup again of new database created and then you would be able to restore it on 2012.Its kind of intermediate way
    Also make sure your DB size is less than 10 G as max DB size supported by Express edition is 10 G and if your DB size is more than 10 G restore will fail.
    You are also trying to restore enterprise DB backup on express edition so you will loose enterprise features on express edition
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • How to modify stored procedures in SQL Azure database in SQL server express 2012

    Hi,
    I want to modify stored procedures in SQL Azure database in SQL Server Express 2012. But when right click on the stored procedure in Object Explorer, there is no option "Modify" as for SQL Server database. I wonder how to modify stored procedures in SQL
    Azure database in SQL Server Express 2012. Thanks.
    York

    Hi,
    Not sure whay there is no modify..
    As a workaround can you try this and see if you can modify proc..
    Script Procedure As-> Alter To->New query window..
    - Chintak (My Blog)

  • Can i open an SQL express 2005 database in SQL server express 2012?

    Hi,
    i have a database and it's in SQL express 2005 but because my windows 8 is not compatible with the installer, i have to install the latest 2012 installer. my problem now is that i cannot open it in the 2012 edition..what do i have to do?

    Hi white_roses,
    Could you let us know how do you restore the database to SQL Server 2012 Express edition? Please help to collect the detail error information of this issue, it will benefit for us to do further investigation.
    As Sandesh and ED suggested above, we can directly detach our databases from SQL Server 2005 and then attach them to SQL Server 2012. For detail steps, please refer to the following article:
    http://msdn.microsoft.com/en-us/library/ms187858.aspx
    After we move a database from the instance of SQL Server on server A to the instance of SQL Server on server B, users may be unable to log in to the database on server B. If need the logins information on Server B, please refer to the following article:
    http://support.microsoft.com/kb/918992
    If you have any question, please feel free to let me know.
    Thanks,
    Jerry Li

  • Error when creating a database on SQL Server 2012(Virtual Machine)

    Hi,
    I create a virtual machine on VMWare Workstation 10, then install Windows 7(32bit), then install SQL Server 2012 Enterprise version.
    Then I write a Visual C++2008 program and using ADO to connect to the local SQL Server, with the connection string below:
    “Provider=sqloledb;Data Source=(local);Integrated Security=SSPI;”
    The connect succeed, then I try to create a new SQL Server database by calling:
    m_pConnection->Execute(_T(“create database MyDatabase on primary (name = ‘MyDatabase’, filename = ‘E:\\MyDatabase.mdf’)”), NULL, 0);
    where E: is a USB drive plugged in.
    When running the above statement, I can even see the MyDatabase.mdf file is being created, but finally get an error and error number is 80040e31 when checking the error from m_pConnection, after analyzing the com exception, we find it reports the error as
    “IDispath error #3121”. Both errors seem to indicate a “Timeout error”.
    Then I try to create the database on the local drive in the virtual machine, as follows:
    m_pConnection->Execute(_T(“create database MyDatabase on primary (name = ‘MyDatabase’, filename = ‘C:\\MyDatabase.mdf’)”), NULL, 0);
    Then I get error number: 80040e14 from m_pConnection, and com error is “IDispath error #3092”
    What is the problem?
    Thanks

    Hello chcw,
    SQL Server 2012 Enterprise doesn't support to install on Windows 7 Opeating System. For detail information, please refer to the article below:
    The article shows the operating system requirements for the principal editions of SQL Server 2012:
    http://msdn.microsoft.com/en-us/library/ms143506.aspx#top_principal
    Here is an article for your reference, please see:
    How To  Create a SQL Server Database Programmatically by Using ADO.NET and Visual C# .NET:
    https://support.microsoft.com/kb/307283/en-us
    If you have any feedback on our support, please click
    here.
    Regards,
    Elvis Long
    TechNet Community Support

  • Creating dynamic database connection (SQL server 2008) from Adf application

    Hello,
    I am creating an ADF Fusion Application. I use Jdev. 11.1.2.3.0 , WebLogic 10.3 and MS SQL server 2008 database. My question is that how can I create a database connection configuration file, now I connect to the database through hard coding, there should be a way to do this with sql server I think.
    my database name is : testDatabase
    my database username is : testUser
    my database password is : testPassword
    Anybody can help me please.
    Thanks,
    Shahe

    Hello Frank,
    The database schema is the same for all the users, but the location of the database differs, for example: I have set the hostname of the database to localhost because the database is installed on the local pc, but to other clients the database is installed on a managed server so in the hostname I should put the server's ip address or name. So I need an external file where I can set these options.
    Thanks,
    Shahe

  • Error during database connection to the database : MS SQL Server 2008 R2

    Hi All,
    I am working with ABAP Proxy to Rec JDBC( Integrating XI with MS SQL Server 2008 R2). I am using SAP PI 7.0
    I am getting error in RWB at communication channel monitoring :
    Error during database connection to the database URL 'jdbc:microsoft:sqlserver://10.1.92.111:1433;database=XONTUSERVENTURA_ORG_TEST' using the JDBC driver 'com.microsoft.jdbc.sqlserver.SQLServerDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Cannot establish connection to URL 'jdbc:microsoft:sqlserver://10.1.92.111:1433;database=XONTUSERVENTURA_ORG_TEST': SAPClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver'
    I have given Connection details at Rec JDBC Communication channel as :
    JDBC Driver as : com.microsoft.jdbc.sqlserver.SQLServerDriver
    Connection : jdbc:sqlserver://10.1.92.111:1433;database=XONTUSERVENTURA_ORG_TEST.
    Please help me in this regard. I really appreciate your valuable information and time.
    Thanks and Regards,
    Ayub.
    Edited by: Ayubsajjid on Feb 15, 2012 8:49 AM

    Hi All,
    Thanks for all your valuable inputs on my question...
    As per all your inputs, we have to install/Deploy the below required jar files in the aii_af_jmsproviderlib.sda file
    ojdbc14.jar
    msbase.jar
    mssqlserver.jar
    msutil.jar
    Can you please tell me from where we will exact this .jar file, bcoz we have search lotzz but we helpless.
    We install from this link http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=21599--> we download sqljdbc_3.0.1301.101_enu  file >sqljdbc_3.0>enu-->in that I find sqljdbc.jar and sqljdbc4.jar files only . I cant above said .jar files.
    Please help me.
    Regards,
    Ayub.

  • Remove Deteled Databases from SQL Server Management Studio List

    Hi,
        I am using SQL Server Express 2008 Management Studio & in the databases list are some databases that are non existent (have been deleted in Windows Explorer). How do I remove them as trying to delete when logging in using Windows authentication
    fails?
    Thanks
    Paul.
    Paul Wainwright

    Hi pr_wainwright,
    I’m writing to follow up with you on this post. Was the problem resolved after performing our action plan steps? According to your description and error message, we need to verify if your windows login account has sysadmin permission. The error 3701 occurs
    when you use an account to execute the script who has not grant the permission about modifying database properties and creating database. I do a test, when the SQL Server Service is stop, I delete the data and log file of database from Windows Explorer, then
    restart the service again, and connect to the SQL Server instance via windows login account which is sysadmin role. In SSMS list, you can right click the database and choose “ delete” option. Or you also use the drop statement by using master database first.
    and two ways can all run well.
    Regards,
    Sofiya Li
    If you have any feedback on our support, please click here.
    Sofiya Li
    TechNet Community Support

  • I have Apple Pro Apps that crash. Crash logs say Pro Kit framework is missing in the user library. I run Lion 10.7.4. Does anyone know how to fix this?

    MBP late 2008.
    Intel 2.66 GHz Core 2 Duo
    8 GB 1067 MHz DDR3
    Logic Pro 9.1.7

    This is a part of the larger MacBook Pro connectivity issue. There are several related threads dealing with the MBP's networking problems. If your unit is suffering from this type of difficulty, good luck ... (or a long ethernet cable)
    (PS Everybody please make noise on this one so apple comes up with a solution.)
    < Edited by Host >

  • How  to access database in Sql Server 7.0 using Java

    I am trying to access a database in SQL Server 7.0 using JDBC.But it is giving me errors.I have used following statements to connect the database
    private String URL = "jdbc:odbc:DatabaseName";
    private String userName="user";
    private String passWord="password";
    Class.forName( "sun.jdbc.odbc.SQLServerDriver" );
    connection = DriverManager.getConnection( URL,userName,"passWord" );
    where "username" and "password" are user Name and password respectively to access the database in SQL Server 7.0.

    I am sorry but I have written like;
    private String URL = "jdbc:odbc:DatabaseName";
    private String userName="user";
    private String passWord="password";
    Class.forName( "sun.jdbc.odbc.jdbcOdbcDriver" );
    connection = DriverManager.getConnection( URL,userName,"passWord" );
    where "username" and "password" are user Name and password respectively to access the database in SQL Server 7.0. And I have used the same name in "ODBC data source" as that of the database.I am trying some examples from book and these examples just work fine with MS Access( I created those databases in Access and tried the examples) but not with SQL Server 7.0. Do I need a separate driver or something?

  • Issues in Importing Access Database into SQL Server 2014 Express

    I have been trying to import the Northwind.accdb database into SQL Server 2014 Express using the SQL Server Import and Export Wizard. Every time I try, I end up with the following messages. I have reviewed previous replies given to similar queries but
    I am not getting anywhere. Appreciate if anyone can help. Thanks.
    Error 0xc0202009: Source - Customers [1]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E37.
     (SQL Server Import and Export Wizard)
    Error 0xc02020e8: Source - Customers [1]: Opening a rowset for "`Customers`" failed. Check that the object exists in the database.
     (SQL Server Import and Export Wizard)
    Exception from HRESULT: 0xC02020E8 (Microsoft.SqlServer.DTSPipelineWrap)

    Tried that. It doesn't support SQL Server 2014. Tried using SQL Server 2012. Ended with following error:
    First I got this message:
    You are connecting to SQL Server version that is different the version specified in the SSMA project. This may lead to schema not converted correctly and synchronisation issues. Do you want to continue?
    I replied with 'Yes' and that ended with the following error.
    Connection to SQL Server established successfully.
    Connection string: Server=VPCL12S1E\SQLEXPRESS2014;Trusted_Connection=TRUE;Encrypt=FALSE;TrustServerCertificate=FALSE;Application Name=SSMA for Access;Pooling=False;
    Error collecting data. See the inner exception for details.

  • Creating ODBC DSN for SQL Server in LINUX

    Hi All,
    I am getting probelms in creating DSN for SQL server. I have created an entry in odbc.ini file under ODBC sources and provided the SQL server detiails as follows
    [ODBC Data Sources]
    AnalyticsWeb=Oracle BI Server
    Cluster=Oracle BI Server
    SSL_Sample=Oracle BI Server
    SQL_DB=DataDirect 5.1 SQL Server Wire Protocol
    [SQL_DB]
    Driver=/u01/OracleBI/odbc/lib/SEmsss23.so
    Description=DataDirect 5.1 SQL Server Wire Protocol
    Address=172:16:1:169, 1433;
    AlternateServers=
    AnsiNPW=Yes
    ConnectionRetryCount=0
    ConnectionRetryDelay=3
    Database=actdb/act7
    LoadBalancing=0
    LogonID=oracle
    Password=tiger
    QuoteID=No
    ReportCodePageConversionErrors=0
    When I test the connection ,i am getting the following error
    +[nQSError: 16023] The ODBC function has returned an error. The database may not be available, or the network may be down.+
    Can you please help in fixing this issue.I am not sure of the Drivers and the descrition that I am using are correct or not.
    Please let me know the process of creating the DSN for SQL server in LINUX and also how can we check the available drivers in LINUX?
    Thank You in advance,
    S1r1

    OBIEE does all of its data retrieval from the server. Your server needs to be able to query all of the data sources that you define.
    The client is irrelevant here, it's just a web browser consuming data that the BI Server returns to it.
    So yes you need to define connectivity from your Linux server to your SQL Server box.
    The Systems Requirements doc (http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/e10417.pdf) details DataDirect ODBC drivers that are provided for non-Widows connectivity to SQL Server

  • A field of the table in sql server db can't be updated with the db adapter

    Hi all,
    I am using db adapter to update data in bpel. The database is sql server.
    But on the running time, i find a field which named 'JDBCT1' can't be updated. all the other fields of this table can be updated properly.
    For the operation type, i have tried the update only and execute pure sql. None of them works.
    The version of SOA is 11.1.1.6.
    Can any one give some solutions?
    It's urgent, thank you!

    Hi,
    Pls check the data type in your mapping file and data type in table. It might be mismatched.
    thanks

Maybe you are looking for