View Complete Post
I use in my ASP.NET MVC application repository pattern and I use in controller for example 3 models:
public class HomepageController : Controller
private IWebsitesRepository _repository_websites = new WebsitesRepository();
private IFirmRepository _repository_firm = new FirmRepository();
private IPhotosRepository _repository_photos = new PhotosRepository();
In WebsiteRepozitory, FirmRepository and PhotosRepository classes I have:
Database1Entities _entities = new Database1Entities();
So I have 3 connections to database ? Is it wrong ? How can I solve it ?
MSDN Magazine June 2000
I am using visual studio 2005 and sql server 2005.
I am developing a small quiz application and i have stored the connection string in app.config file which is given below.:
<?xml version="1.0" encoding="utf-8" ?>
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Quiz Application.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
i have retrieved connection string property through configurationmanager class
and when i m connecting to database it gives me a runtime error:
Sql Exception was unhandled
System.Data.SqlClient.SqlException was unhandled Message="An attempt to attach an auto-named database for file F:\\Quiz\\Quiz\\bin\\Debug\\Quiz Application.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located
I had successfully restored sql 2000 database to sql 2005. It works like charm
Now i am creating a database model in MVC
I follow these steps
Right click on model > ADO.NET entity data model > Generate from database > New connection (Microsoft sql server) > server name > select or enter database name
But no server name AND database name show in both drop down lists. When i mannually enter database name (which exists in sql 2005) then click on TEST CONNECTION. It gives follwoing error
"A network-related or instance-specific error while establishing a connection to sql server. the server was not found or was not accessible. verify that the instance name is correct and that sql server is configured to allow remote connections.
Kindly help me with this
Has anyone deployed a website using the login database in the visual studio 2010 asp website template? I was wondering if I could look at someone's example to see how the integrated this into their website.
when i open my central administation i get this error:
Cannot connect to the configuration database
Recently I have migrated my SharePoint BackEnd (Database) Server to new hard drive. The reason of migration was to deploy and configure real time database replication by
Symantec Veritas. After migration activity I was getting following error message
" cannot connect to the configuration database ".
But when I execute following steps, this errors message gone and everything got fine
1. Enable Named Pipe from SQL Server Configuration Manager >
Protocols for MSSQLSERVER
SQL Server (MSSQLSERVER) service (Note: This service was already running and status was set to automatic ) and
3. Start SharePoint Configuration Wizard
Now I need to know why every time I have to restart this service?
When I turned on my sharepoint server machines in the moring I have to restart this service ( SQL Server (MSSQLSERVER) otherwise same error message appears (cannot connect to the configuration database). After restarting this service everything
Any help in this regard will be greatly appreciated.
I know this is a simple thing but i donÃÂ´t how to.....
I have the website working on my pc .... but i want to get it online with the database.
Do i have to put debug to false to publish it?
thanks in advance for your patience