Visual Studio :: Connection Property Error The Connection Property In The Web.config File Is Missing Or Incorrect In VWD 2010?
Apr 18, 2010
When I open an ASP.NET 3.5 project using VWD2010, I get a prompt error message,"The connection property in the web.config file is missing or incorrect.The connection string from the .dbml file has been used in its place."however, my project works successfully.
I have myConnectionString and it's working fine. In the Server Explorer, the Data Connection is even using myConnectionString to connect to the database. When I created my .dbml, it uses that same yConnectionString. However, now whenever I opened the .dbml file, pops up with the following message:The connection property in the web.config file is missing or incorrect.The connection string from the .dbml file has been used in its place.After this message is display and I clicked okay (because that's the only option), it creates myConnectionString2 in the web.config file with a different ID but no password provided. What is this all about? Why is it creating a second connection string with a different ID?
I'm using Visual Studio 2008, and my database is SQL Server 2000.
I want to add a connection to the Server Explorer in VS. The Data source is Microsoft SQL Server (SqlClient). After entering in all my information and I click Test Connection, it is successful.
But when I click OK, I get the error:
Unable to add data connection. ExecuteScalar requires an open and available connection. The connection's current state is closed.
I have VS 2010 professional. I am trying to open "ASP.Net Configuration" through Project -> ASP.Net Configuration.
It pops up the Notification about the ASP.Net Development Server localhost but doesn't open ASP.Net Configuration in the default browser.I clicked on the Root Url (by double clicking on the 'development server' at the right bottom from Notification Manager).
It throws following error
"An error was encountered. Please return to the previous page and try again."
Clicking on "How do i use this tool".It opened page with error.
when i opened my Visual Studio 2010 i noticed that my ajax tab was missing from my toolbox and ajax control kit too.Then i noticed even that when i create new website, there is no web.config in it and it should be.WHAT IS GOIN ON???? :/
I am getting error ExecuteReader: Connection property has not been initialized. below is the code i am using.
SqlDataReader oReader = new SqlDataReader(); string sSQL = @" WITH TAB_CTE AS ( SELECT fbominum, fbompart, fparinum, flevel, fsono FROM sodbom WHERE fbompart= @fbompart and fsono = @fsono UNION ALL SELECT e.fbominum, e.fbompart, e.fparinum, e.flevel, e.fsono FROM sodbom e INNER JOIN TAB_CTE ecte ON ecte.fbominum = e.fparinum where e.fsono = @fsono ) SELECT * FROM TAB_CTE where fbompart <> @fbompart "; SqlCommand oCommand = new SqlCommand(sSQL, this._connection); oCommand.CommandType = System.Data.CommandType.Text; oCommand.Parameters.Add("@fbompart", ItemSODBOM.fbompart); oCommand.Parameters.Add("@fsono", ItemSODBOM.SONO); oReader = oCommand.ExecuteReader();//Here I am getting error
I am getting above mentioned error when I try to run the following code:
Private strConnString As String = ConfigurationManager.ConnectionStrings("conString").ConnectionString Private con As New SqlConnection(strConnString) Private pID As Integer 'FIRST SECTION Dim query As String = "query" Dim cmd As New SqlCommand(query)
[Code] .....
The error is coming from the second SQL cmd but if I comment out the first section; the second section runs fine.
I must have made another basic error but I just can't figure out what it is.
I just moved into a new computer running Windows 7 pro, and I installed a new copy of VS2010. Now all of my old sites that I made in VS2008 do not have their web.config files. Does anyone know what happens to them in VS2010, or Windows 7?
just for my testing purpose i know i can define both the connection's outside in a single web config file by different name's and access them in my front end according to it but what if i want to have seprate for both connection's web.config situation is like this see image so i want to access my connections from second web config file how i can do that.
Data -> Add new data source -> ... -> Save the connection string to the Application configuration file (yes, save the connection) result in "An unexpected error has occured." Error Message; Could not load type 'Microsoft.VisualStudio.DataDesign.SyncDesigner.SyncFacade.SyncManager'from assembly 'Microsoft.VisualStudio.DataDesign.SyncDesigner.DslPackage,Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
In some posts I have read on other forums, those with database connection problems (I am thinking about Access) sometimes get the error: 'Connection property has not been initialized' which might translate as 'you have not kick-started your connection'. One reason for that, according to a number of replies I have come across, is that 'you have not set the connection property of the command object' ('you have not told command how to connect').
So would something like this:
Code: Dim conn As New OleDbConnection Dim OleDbConnection As New OleDbConnection Dim cmd As New OleDbCommand conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|myDatabase.mdb;" conn.Open() cmd = New OleDbCommand("SELECT strName FROM school WHERE strName=@strName", conn) cmd.Parameters.AddWithValue("@strName", UserName.Text) cmd.Connection = conn cmd.ExecuteNonQuery() conn.Close()
a) initialise the connection property and b) set the connection property of the command object?
I have created a webservice in 2010. And when I call it from my web application sometimes,It generates the follwoing errors:-1. The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.2. Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.I have already tried increasing excutonTimeOut etc.
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. make sure the user has a local user profile on the computer. The connection will be closed.
I recently started NOT putting code in separate file. I am using vb. I am having a problem with my database connection. The live code is working just fine....but when I try to debug locally. i get this error. connection to the database from my local visual studio is not working. A network-related or instance-specific error occurred 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. provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" %> <script runat="server"> Const ConnectionString As String = "Data Source=1234.database.com;Initial Catalog=database_name;Persist Security Info=True;User =user_name;Password=123456" Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Dim MyConn As New Data.SqlClient.SqlConnection(ConnectionString) Dim cmd As New Data.SqlClient.SqlCommand("Select count (*) from Classifieds where (ClassifiedCatagory = 'Antiques')", MyConn) cmd.Connection.Open() Dim count As Integer = cmd.ExecuteScalar() 'this contains the number of records Label_Antiques.Text = count cmd.Connection.Close()
I have one intranet based application.I have set windows authentication for it in Web.config as well as from IIS settings. While running my application through the source code, it works fine but while running from directly IIS then its giving me:
Background: I use SQL server 2005 developer edition and visual studio 2008. Visual studio 2008 is running on a local machine with Vista business edition. SQL server is running on a remote server using Windows server 2003. Both computers are within the same domain.
Problem: First, I used the server explorer to connect to the SQL server. Everything works as desired. Then I write code to do the same thing. I keep getting the following error message:
A network-related or instance-specific error occurred 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. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid)
However, I used the exactly identical connection string as the one used in the server explorer. So connection string should not be the problem. In addition, I tried the test code in MSDN, which tells whether my domainusername can flow the network. It turns out the user name is fine. I also went to the SQL server management studio and found the login for my computer is NVCWeihao while my computer login name is NVCweihao. I am wondering if this uppercase letter really affects the connection.
Im using two stored procedures to write and update values in a SQL DB. Im using the SQLDatasource update method. When I run the webpage on my development server everything runs fine. When I try and run the web page on my Live server I get the following error :System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding This always takes 30 seconds to fail - and looking at google it seems that this is a connection timeout error.In my web.config file I have updated the connectionstring line to include a timeout setting :
I am preparing for an Access2007 db conversion at the beginning of the year and would like to know what the best process would be for connecting to the sqlserver2005 database. I have read about adding the connection string to the web.config file. I have also read about using ADO.NET and put the connection information into a class and not the web.config file.
I would like to hear from others as to what you have used, are using, or plan on using for a webapp (vs2010), and why so I can get an understanding.
I just recently upgrade my asp.net web project from visual studio 2005 to visual studio 2010. The upgrade was successful with no problems however im missing some features with this project. The One Click Publish feature(which is greyed out) in the header area of Visual Studio 2010 and the Add Config Transforms feature which is no where to be seen when you right click on web.config. When i create a new web project straight from visual studio 2010, these options work fine.
my visual studio 2010 has the following problem, can't see the missing characters. Everything is fine, if I do a copy to notepad, it will show up. The intellisense is fine. (I manually removed the characters after copying here). My beta2 started to have the problem a month ago. Now I installed RC, same problem. My windows is XP SP3.
using ystem; using ystem. ollections. eneric; using ystem. inq; using ystem. eb; using ystem. eb. vc;
namespace vcApplication3. ontrollers { public class ccount ontroller : ontroller { // // : /Account/ public Action esult ndex() { return iew(); } } }