.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Database connection error

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
Hi,I am trying to connect to a database in visual studio 2008, and I get this error. The database 'C:\~\VISUAL STUDIO 2008\PROJECTS\~\APP_DATA\ASPNETDB.MDF' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported.Could not open new database 'C:\~\VISUAL STUDIO 2008\PROJECTS\~\APP_DATA\ASPNETDB.MDF'. CREATE DATABASE is aborted.An attempt to attach an auto-named database for file C:\Users\Nick\Documents\Visual Studio 2008\Projects\myFacebook\App_Data\ASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.This project was developed in VWD 2008 and I just installed visual studio. But the database gives this error. Anyway I can fix this?Thanks!

View Complete Post

More Related Resource Links

Error in attaching database file and creating a new connection

I am having problem when i was trying to attach .mdf file while create a new connection of SQL server, create a new connection of SQL database file and open the database in Server Explorer. I am using VS 2010 Ultimate and SQL Express 2008 R2.Can anyone please tell me what is the problem I am facing?Here are the error message.1. Attach .mdf in SQL database file and open the database in Server Explorer2. Create a new SQL server and attach .mdf

"Database schema could not be retrieved for this connection" Error using VWD 2010

After downloading VWD 2010 Express. I drag the SQL Data Source, When trying to establish any type of connection get the error below. I CAN connect using the OLE  (.NetFrame data provider for OLE DB work) but CAN NOT connect using (.NetFrame data provider for SQL server) I have VWD 2008 in another PC and work just fine. I did google and tried several solutions that other had with no luck. I know they were not using VWD 2010 but it was the same error. Again no luck with those solutions. If anyone can share it would be greatly apreciated! Thanks in advance!Jimmy "Database schema could not be retrieved for this connection. Please make sure the connection settings are correct and that the database is online. This server version is not supported. You must have Microsoft SQL Server 2005 or later."    

Error with database connection - API client not supported

I keep getting a weired alert on the SQL Server 2005 Box, I would appreciate if some one can assist me in this. However my application is running smoothly, just wondering if any of you have seen such an error 'Alert 1:  Critical Failure in log file for Monitor_DB: Monitor_DB: :__FAILURE__: error with database connection 'HOSTNAME\INSTANCE@master' with error message: API client not supported' I am not sure what API client is trying to connect, I have a BizTalk server which connects to the SQL Server box, and the connections and processing are going on smooth, but still I keep getting this error. Can anyone assist me. Thanks in advance.

An error occurred within the report server database. This may be due to a connection failure, timeo



I can't get Reporting Services to work with Sharepoint.

I've followed the instructions for installation of Reporting Service in SharePoint Integrated Mode, and completed the indicated steps on the SharePoint Central Administration Site successfully.  When I try to create a page with a Reporting Services Webpart, I get the following error:


Invalid object name 'History'.
An error occurred within the report server database.  This may be due to a connection failure, timeout or low disk condition within the database. (rsReportServerDatabaseError)


I have SQL 2008 R2, SharePoint Enterprise 2010, and Report Builder 3.0.  SQL and Sharepoint are installed on the same server.

I'm certain that there isn't a disk or timeout problem, so I'm assuming that it's a connection failure, but don't know what steps to take to troubleshoot and correct this.


Getting connection error to a database when page loads...occasionally...


So occasionally after a run to the database I am getting the following error;

A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)

It always happens after this query is executed during a page Load:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        myconnection = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True")
        myda = New SqlDataAdapter("Select * from diaryDates", myconnection)
        myda.Fill(ds, "diaryDates")
    End Sub

What does the error mean and how can I resolve it ?

Database Connection error


I have create feedback form using C# it contains following controls text box (to enter name), send textbox (to enter email id) and TextArea box (to enter message) & Submit button (to submit form to database) i use SQL 2005.

Following are codes :

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class Feedback : System.Web.UI.Page
    SqlConnection con = new SqlConnection();
    SqlCommand cmd = new SqlCommand();
    string query;
    protected void Page_Load(object sender, EventArgs e)
         Page.Header.Title = "Your Feedback";
    protected void Button1_Click(object sender, EventArgs e)
        query = "insert into feedback (name,emailid,message) values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + textmsg.Textar

Unable to make connection to database?


Hy guys. I try to connect my database for so long so i wrote two type of codes. Let's discuse first on.

I have database called PhoneDirectory.

It have only one table named Residents.

I have button wiht ID="Button1".

I want when i click this button to see all of my residents. 

I want to see the result in DetailsView and to be able to edin, delete and add new resident.

First try with SqlDataSource so i wrote this:

<asp:SqlDataSource ID="Resident Details" runat="server" ProviderName="System.Data.SqlClient" ConnectionStrings="<%$ ConnectionStrings:ThisIsTheConnection%>" 
              SelectCommand = "SELECT * FROM Resident "

Need Oracle Data Provider .CS File for Oracle 10g Database connection !



I need a 'Wrapper.cs' file which takes care of the Database connection ( Oracle 10g) where

i can just call the method with my SQL Query


Gridview1.DataSource = SampleWrapper.ExecuteDatatable("THE SQL QUERY");


Plz Post the link if there is any open source !    

ERROR [HY000] [Informix .NET provider][Informix]Database locale information mismatch


Hi, there is an upgrade to my infimacs server and my web application encounter this error after the infimacs is upgraded.

Below is the information on the server before/after the upgrade.

Before            After

---------       -----------  

Solaris 8      Solaris 10

IDS 9.40     IDS 11.50

The web server where the web application hosted is running IBM Informix Connect 2.81. There is no such error before the upgrade is done.

As a developer, i have IBM Informix Client-SDK 2.90 installed on my local pc and debug the page where the read is needed from infimacs but no such error found.

The error come out only when it is hosted on the web server where IBM Informix Connect 2.81 is installed.

I have gone through many articles and it suggest me to set the environement  variable in the server :  DB_LOCALE=en_us.819.

I haven't try this solution but i think that this might not be the best solution.

Is it possible to to to have this settin

Activation error occured while trying to get instance of type Database, key "DBName"


Im using Enterprise library 5.0
I have a scenario, where I have to access two different databases in my application.

Basically this application is a webservice,delployed on my local for testing purpose.
I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.

Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.

<dataConfiguration defaultDatabase="MYCON1" />
<add name="MYCON1" connectionString="Data Source=server1;Initial Catalog=dbName1;User Id=Username1;Password=password1;"

" />
<add name="MYCON2" connectionString="Data Source=Server2;Initial Catalog=dbName2;User Id=Username2;Password=password2;"
providerName="System.Data.SqlClient" />

Database myDB=EnterpriseLibraryContainer.Current.GetInstance<Database>(); --> works fine for the default database (MYCON1)

Database myDB=EnterpriseLibraryCo

Intermittant error: "A connection attempt failed because the connected party did not properly respon



I'm having a doozy of a problem, and can't find a solution.  I have a WFC Web Service installed to a pair of servers, and accessed through a load balancer.  I am accessing the service from an ASP.NET client app, also via WCF.  The Client is not load balanced.

I'm getting an intermittant error:

(Inner Most Exception) System.Net.Sockets.SocketException:  A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond x.x.x.x:80

(Middle Exception) System.Net.WebException: Unable to connect to the remote server

(Outer Exception) System.ServiceModel.EndpointNotFoundException:  Could not connect to http://<MYSite>/<MYApp>/<MYService>.svc. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond x.x.x.x:80.

I can reproduce this error with about 20% reliability if I execute the exact same page request on the client from 2 browsers at the same time.  When the problem occurs, the successful p

Protect It: Safeguard Database Connection Strings and Other Sensitive Settings in Your Code


Protecting application secrets, such as database connection strings and passwords, requires careful consideration of a number of pertinent factors such as how sensitive the data is, who could gain access to it, how to balance security, performance, and maintainability, and so forth. This article explains the fundamentals of data protection and compares a variety of techniques that can be used to protect application settings. The author discusses what to avoid, such as hiding keys in source code and the use of Local Security Authority. In addition, he presents some effective solutions such as the Data Protection API.

Alek Davis

MSDN Magazine November 2003

The underlying connection was closed: An unexpected error occurred on a send.


I am consuming a third party web service wsdl using my .net aps.net page. And I am getting following error message. Cannt get to resolve it. Its working on my machine but not in my development machine. I have installed the certificate also in certificates on that machine. Can somone please help.?

Error -->  The underlying connection was closed: An unexpected error occurred on a send.





How to fix error in MVC movie database tutorial from Asp.net?


I followed the tutorial at http://www.asp.net/mvc/videos/creating-a-movie-database-application-in-15-minutes-with-aspnet-mvc At 12:04 in the video, the author,  Stephen Walther. inclues the line

            return View(_entities.MovieSet.ToList());
When I tried to compile this I get an error: 
Error 1 'MovieApp.Controllers.MoviesDbEntities' does not contain a definition for 'MovieSet' and no extension method 'MovieSet' accepting a first argument of type 'MovieApp.Controllers.MoviesDbEntities' could be found (are you missing a using directive or an assembly reference?) P:\experiment\MovieApp\MovieApp\Controllers\HomeController.cs 18 35 MovieApp

If I just enter return View(_entities. then Intellisense  offers Equals, GetHashCode, GetType, and TosString.

Does this suggest that _entities is not being i

Error from entity Connection setting in webconfig

hi every one , while building my Asp.net Mvc solution i am getting following error: "The type or namespace name 'HostelerDBEntities' could not be found (are you missing a using directive or an assembly reference?) " Here  "HostelerDBEntities" is entity Connection setting in webconfig i am not sure why it is coming  can any one help thanks

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a rec

Hello Guys,         I am getting following exception while web service (ASMX) is returning the response. <!-- [if gte mso 10]> <mce:style> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive.     <!-- [if gte mso 10]> <mce:style>                                                     InnterException (System.IO.Exception): "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."       I think either the Asp.net web server is closing the connection or the response is too long.   Following is my simple code.    1)   namespace JFA.IndiePay.BusinessAccess { public class VerTexProcessor { public DataSet ProcessVerTexForBatch(DataSet dsInputRequest) { DataSet dsResponse = new DataSet(); //Call vertex web service here. VertexService.Service texCalculator = new VertexService.Service(); texCalculator.Timeout = 500000;

DATABASE/ADO ERROR need help asap please!

  We are running SQL server 2005 under WS 2003.  This error is showing up in our log every time there is a select.  I  have looked everywhere for a solution and cannot find one that works.       DATABASE/ADO ERROR  Error Number: -2147467259 Error Description: [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send()). Error Source: Microsoft OLE DB Provider for ODBC Drivers  
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend