I'm trying to configure a DotNetNuke 7 (DNN 7) but the following error occur
ERROR:Index #: 0
Source: .Net SqlClient Data Provider
Class: 20
Number: 2
Message:
the database is SQL server 2008 R2, both database and web server on localhost. I checked the username and all instruction in the following like carefully but nothing changed
the installation guide link
http://www.dnnsoftware.com/community/learn/video-library/view-video/video/515/view/details/dnn-7-0-installation-part-1-file-system-configuration
Check to verify that you SQL Server instance name is the Default instance, if it isn't, you'll need to change the name when connecting to it.
Something like "localhost" would work for the default instance, but if you named it something else, you would use "localhost/somethingelse"
You also should attempt to connect to your DB server using SQL Server Management Studio, with the exact same information you are trying to use in DNN.
This is an elder question, but hopefully somebody benefits from this answer.
My connection string in DNN's web.config looks like this:
<add name="SiteSqlServer" connectionString="Data Source=.\SQLExpress;AttachDbFilename=|DataDirectory|Database.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
This is an SQL Server 2016 Express instance. The MDF file will be in the App_Data folder of the DNN installation.
Related
Ok, So I just installed visual studio code with 150GB of libraries and tools, and the episerver plugin. When you fire up a new episerver project, it magically creates a database.
I need to wipe this database some how, or create a new one and point episerver to this.
The question is, how?
If this was mysql, I would fire up heidisql, or mysql workbench, put in localhost:3306 and the admin username and password.
I tried installing SSMS, but when I run this, it does not see any databases - it doesn't seem to be able to "see" sql server express databases.
Trying to reverse engineer this, episerver is using the following connection string:
<connectionStrings>
<add name="EPiServerDB" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|EPiServerDB_faa2d554.mdf;Initial Catalog=EPiServerDB_faa2d554;Connection Timeout=60;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
</connectionStrings>
Googling revealed one lead: sqlcmd.
But I have no idea what parameters I need to connect? I dont know what the server, port, username, password or database name is.
Any suggestions?
It's been a while since I did this, but I think you'd have your connect window like this:
And then when conencted you'd right click the databases node and choose Attach... (and pick the EPiServerDB_faa2d554.mdf
You might be able to specify the filename in the Additional Connection Parameters in the advanced
Try:
SQLCMD /S (LocalDb) /d EPiServerDB_faa2d554
This should connect you to the database.
Otherwise, if you want to connect through SSMS, you can try:
Server Name: (LocalDb)\MSSQLLocalDB
or just
Server Name: (LocalDb)
I'm working on a project using SQL Server 2008 Express. I had an instance called SQLEXPRESS and I used to connect to the DB via this connexion string :
<add name="MyConn" connectionString="metadata=res://*/MyDataModel.csdl|res://*/MyDataModel.ssdl|res://*/MyDataModel.msl;provider=System.Data.SqlClient;
provider connection string="data source=PCNAME\SQLEXPRESS;initial catalog=DbName;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
This connection string was generated by .edmx file (I'm working on an ASP.NET MVC project, database first, and Entity Framework) and it worked fine.
I recently installed SQL Server 2016 with a Developer Licence. During the install process, I used the default instance, which is MSSQLSERVER. For information, the generated InstanceID is MSSQL13.MSSQLSERVER.
I have a SQL project in my solution to regenerate my tables on my new SQL Server; I could connect easily to the server via the wizard.
I also used SQL Server Management Studio to verify everything was fine on the server, and it works perfectly (tables are generated, connection was OK).
However, my code is unable to connect to the server and systematically failed to the first call with error 26 - can't locate server instance
Here is what I've tried so far:
Change the data source parameter of the connexion string to localhost , ., .\MSSQLSERVER, .\PCNAME, PCNAME.MSSQLSERVER, PCNAME.MSSQL13.MSSQLSERVER, DOMAIN.MSSQLSERVER, DOMAIN\PCNAME => Doesn't work
Verify SQL Service are running => They are
Create an .udp file, connect to my server, and copy/paste the generated connection string : Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDB;Data Source=PCNAME => Doesn't work
Regenerate my .edmx file (and the connection stirng) => Doesn't work
Verify this suggestion => It was already correct
Why does all the connection wizards seems to work (SSMS,
.udl file, .edmx generator, my DB project), whereas my code is unable to reach the server? I didn't change any line of code.
EDIT : The crazy thing is I have a log database on the same server, the connexion string is
<add name="NLogConn" connectionString="Data Source=localhost;initial catalog=DBLOG;integrated security=True" providerName="System.Data.SqlClient" />
And it is actually logging the network error !! So is it really a connection string error or an EF error ? I'm using the latest EF version, 6.1.3 on each project referencing EF (The main and the DAL layers)
Before going off the deep end on what it could be let's start with a working connection string I just tested on my local machine on Visual Studio 2017 Enterprise with Entity Framework 6.1.3.
<connectionStrings>
<add name="TesterEntities" connectionString="metadata=res://*/Tester.csdl|res://*/Tester.ssdl|res://*/Tester.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=Tester;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
The marked up connection string is:
="data source=.;initial catalog=Tester;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"
For my test connection I am using my local server for a default instance also of 2016 developer edition(. is abbreviation for this). I am using integrated security and my database name(initial catalog) I am targeting is Tester.
There are a few things to consider if Entity Framework(EF) is not properly hitting a target.
What version of EF are you using? Before MS moved to Core, I believe the last .NET full edition of EF was 6.1.3. Ensure you are on the most current version on Nuget download.
If you go from Express to a full fledged SQL the connection string's 'provider' often will not be the same I believe. Or it could be the local default instance before sql is installed is different. Ensure you don't overwrite an existing connection string with this. The provider should be: 'provider=System.Data.SqlClient'
You are referencing a project of EF in ANOTHER project. Each project that references EF should be having the NuGet package for EF as well as a config file with the connection string. EG: I have a console project for testing things I write and reference another project called 'EF Testing' and I don't have an app config with a connection string. It won't work.
I am trying to create a database for an MVC 4 application. I used Entity Framework Code first approach. After digging into the problem I realized that it was not a connection string issue. I downloaded Sql Server Data tools and tried to create it from there but I get the same exact error which is related to Windows Authentication. I am not sure what is causing this problem, I even tried running as admin.
Any ideas??
I have tried mostly all forms of connections strings available online, the last two that I tried were
<add name="Request" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=Requests;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\Requests.mdf" providerName="System.Data.SqlClient" />
<!--<add name="RequestsContext" providerName="System.Data.SqlServerCe.4.0" connectionString="Data Source=|DataDirectory|\Requests.mdf" /> -->
I am trying to create a local database, I have asked a question about entity frame work right here thinking that the problem was from there but now I know it has nothing to do with it. Here you can see all of the details about the models I created and I am trying to generate the database from.
Using Entity framework with SQL Server 2012 (local *.mdf database)
You don't have SQL Server installed on your PC. Install Express Edition and you should be fine.
EDIT: Use connection string for local server:
<add name="Request" providerName="System.Data.SqlClient" connectionString="Server=.\SQLEXPRESS;Database=Request;Integrated Security=True;" />
If its local, probably SQL Server service is not running. Start>cmd and services.msc will open services page. Right click on sql server and start
i am really frustrated from this problem, i am trying to install DNN 7 in windows server 2008, i follwoed the steps in DNN site for installation, but when i run installer wizard i am getting connection error, i give the user permission on Folder level, as owner to the database, and still nothing, do i need to modify the connection in web.config file? is this correct
note:
database name: dnndev.me
user name: Administrator
Password: password
<add name="SiteSqlServer" connectionString="Data Source=.\SQLExpress;Integrated
Security=True;User Instance=True;AttachDBFilename=|DataDirectory|dnndev.me.mdf;"
providerName="System.Data.SqlClient" />
please help
this is my second post and i am not getting answer
How's your SqlServer set up? If the server is setup to use integrated security, you really don't need a username/password as Chris pointed out. In that case, the connection string in your web.config <ConnectionString> and <AppSettings> sections should look like
Data Source=.\SQLExpress;Integrated Security=True;User Instance=False;Database=dnndev.me;
Check out this blog for more details.
If you are using SQLExpress, and you have SQLExpress installed locally using the default instance, you don't need to worry about usernames/passwords for the database. DNN will attach the MDF file in the app_Data folder automatically.
If you are using another INSTANCE of SQL, than you will want to create the Database, and then associate a username/password that is DB_OWNER for that database, and provide that during the installation process. If that is the case, DO NOT choose the SQL Express option, use the SQL 2008 option.
Every time I have a fresh install of Windows, Visual Studio and Sql Server I always have problems getting an application to connect to the local instance of Sql Server.
I am trying to start an application using Entity Framework code first. Here is my connection string.
<add name="KCSoccerDataContext"
connectionString="Data Source=.\MSSQLSERVER;Initial Catalog=KCSoccer;Integrated Security=SSPI"
providerName="System.Data.SqlClient" />
I am able to connect to the database instance using Sql Server Management Studio, but can't seem to connect using this connection string. I am assuming the problem has to do with how the database instance is configured.
The error I'm getting is
{"The provider did not return a ProviderManifestToken string."}
I'm not exactly sure what this means or where to go from here.
Any help anyone could give on this would be awesome.
Thanks
Use just this connection string:
<add name="KCSoccerDataContext"
connectionString="Data Source=.;Initial Catalog=KCSoccer;Integrated Security=SSPI"
providerName="System.Data.SqlClient" />
MSSQLSERVER is name of default instance. It is not used in connection strings. It even doesn't work from Management studio if you try using it. Only names of custom instances must by used.
You probably didn't enable remote connections for SQL Server since it's a fresh installation. Follow first solution here or here.