MSDN Magazine June 2000
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 ?
Whenever I open my Crystal Report page, I am taken to the Database Authentication page where I am asked for
User name Data Name Password
Is there a way to avoid this and I save these authentication in my page once.
I am using VS2005, C#.
Any Help will be appriciated.
I have a web site that is highly dependant on a SQL Server 2008 database. I am using linq to sql to connect to the database and require the website to reflect database changes immediately. Currently the changes are only reflected once a postback occurs and the database is requeried.
Is there a way to get the asp.net page(s) to be alerted of an database change and then to reflect it immediately, or within seconds, on the display? I am aware that one can use the SQLDependency class and ADO.NET to do this, but am not aware of any linq to sql possibilities.
Any help will be greatly appreciated.
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
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.