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 previously used a datasource and a connection string to connect to my database on sql server and all orked fine. The connection string was saved in my web.config file and is: ....
I have a project where we need to launch a browser window from a desktop application and provide the newly opened page with XML data for it to process before the page fully renders itself.
Sub WinAppButton_Click 'Generate xml data 'Open url in browser and post xml to the page without any visible http request arguments showing. End sub
Handling the xml data from the page_load is easy enough. Getting the initialization data to the page is the problem.
i have grid with linkbutton and path of image files how can i open that images in windows default application below is the code in rowdatabound LinkButton btn = new LinkButton();
The oddity is, that the same website files, copied and pasted, connection string altered to point to the production/live db, published to the httpdocs folder works fine BUT the same web files, copied and pasted, connection string altered to poin to the dev db, published to the subdomains/dev fodler causes the error below:
------ Build started: Project: AHN, Configuration: Debug Any CPU ------ AHN -> P:Web_DevelopmentxxxDEVinxxx.dll ------ Publish started: Project: xxx, Configuration: Debug Any CPU ------ Connecting to ftp://xxx.co.uk/subdomains/dev/httpdocs... Transformed Web.config using Web.Debug.config into objDebugTransformWebConfig ransformedWeb.config. Copying all files to temporary location below for package/publish: objDebugPackagePackageTmp. Deleting existing files... An error occured trying to enumerate the contents of folder ''. Can't open data connection (425). ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ========== ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
When I asked the hoster whats going on, he obsiously that its not his fold because the publishing is working for the non-subdomain (dev) site. Moreoever I deleted and recreated the /dev subdomain but the error is the same.
I deployed my MVC app to IIS 7.0 and I keep getting the following error; ExecuteNonQuery requires an open and available Connection. The connection's current state is closed I dont get this with the app locally on my machine. Where could this error be occurring??
I have a page with a listview bound to a database. The user selects an item on the list, hits submit, and a new window opens up with the selection as part of a query string. I need the user to be able to select multiple items and open up multiple new windows. Heres my code:
[Code]....
Currently, the first selection will open up a new window, but none after that.
In my asp.net +vb+access web i have made a login page and the code is as under
Dim connectString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:webauth.mdb" Dim con As OleDbConnection = New OleDbConnection(connectString) con.Open() Dim cmd As New OleDbCommand("select * from Users where userid =@userid and Password=@password", con) cmd.Parameters.AddWithValue("@userid", txtUserName.Text)
[Code] ....
I am getting error The connection was not closed. The connection's current state is open.
I have problems connecting to my database server. The database server is not local, I am connected via its IP address. It works fine in my development machine. After publishing the website to my server, it can not connect to my database server. 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)Why can't my publish server connect to the database server, whereas it works fine through the development machine?
When should i open and close the database connection.and which are best data classes (for e.g dataset, datatable etc) should i use when connection is open or close.
I am using VS2008 and oracle 10g ODP.Net. The oracle database that I used in the connection is working and tested it using sql plus.The connection string when used in a GriDView works perfectly. Now when I created a new listview control with the same connection it gives an error.Database schema could not be retrieved for this connection. Please make sure connection settings are correct and the database is online
Object reference not set to an instance of an object at VSDataObjectSupport (478,6)
This is regarding ASP.Net (VB) 2.0 and SQL Server 2008. My project's (there is only one in my solution) has a "Start Action" set to a "Specific Page" (..FormsfrmMain.aspx). Occasionally (though not always) a large number of connections (30+) will be opened prior to the frmMain.PreInit event. These connections stay open for quite some time. I am closing all of my connections with extreme prejudice. In my "finally" clause of my try...catch I have myconnection.close. Immediately after the "End Try" I have myconnection.dispose (redundant, I know). I have accounted for all connections. I placed a breakpoint on frmMain.PreInit and then (sometimes) a large number of connections (used SSMS to run sp_who and sp_who2) will have just opened.What would open a large number of connections prior to the starting page's preinit event? I am closing (and then disposing) all of my connections. I thought that I must be missing a myconnection.close in the "finally" clause, but I have looked repeatedly and cannot find anywhere that a connection is open and then not closed. Also, I do not believe that I have even opened a connection prior to the frmMain's preinit event.
this is general to any operation calling an SQL server, or anything requiring an open connection at that.Say I have anywhere from 20 to 1000 Select calls to make for each item in data being looped. For each step, I'll select from sql, store data locally in a struct, then proceed. This is not a very expensive call, so should I keep the connection open for the entire loop? Or should I open and close every step? How expensive in run time is opening a connection? I would think it'd be better to keep the connection open, but would like to get the correct response for this.
I am trying to connect linq to dbf file. I am using VS2008 on windows xp with sp2. For most part I can create a connection and see the tables in the server explore, but when I try to drag and drop a table onto the .dbml i get "The selected object is an unsupported data provider". I have been trying to use FoxPro to connect to the DBF. In VS in the Data Connections I go to modify the connection and hit test and the connection says success, but no tables appear.
I am writing a windows service but normally I write only asp.net apps. In asp.net app I store my connection strings in a web.config file, what is the correct place to store connection strings in a windows service?