.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 test

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :ASP.Net


I'm trying to incorporate a database connection test into an application I'm writing.   In the connection function, I would like it to loop connection.Open() a certain number of times before it throws the exception.   is this possible?

View Complete Post

More Related Resource Links

A connection cannot be made to the database. set and test the connection string


Hi All,

i have configred SSRS with Sharepoint integration mode everything was successfull. Now when iam trying to create sample report which pulls the data from lists. i have done the below steps.

1) Business Intelligence Projects -> Report Server Project
2)Right-click on Shared Data Sources and select Add New Data Source
 General tab
 Name: DataSource1
 Type: Microsoft SQL Server
 Connection String: http://localhost:3000/_vti_bin/Lists.asmx?op=GetListItems

 Credentials Tab
 Selected radio button: Use Windows Authentication(Integrated Security).
Clicked Ok.

3)Right-Click on Reports (New item-> Report)
4)Dataset: selected new dataset
 Query Tab
 Name: DataSet1
 Datasource: Datasource1(as above)
 Command Type: Text
 <Method Namespace=http://schemas.microsoft.com/sharepoint/soap/ Name="GetListItems"/>   <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>

 Parameters tab:

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 !    

Unit Testing: Apply Test-Driven Development to your Database Projects


Jamie Laflen extols the benefits of TDD when applied to database development-and supplies some useful techniques along the way.

Jamie Laflen

MSDN Magazine Launch 2008

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

How to copy table data from test to production database

I'm using SQL Server 2008 R2 and I'd like to copy all data rows from one table of a test database to the identical table in a production database. The primary key of the table is referred to by other tables so a DELETE followed by a number of INSERTs won't do it because of referential integrity issues. What is the best method to replace the data rows in the destination database with the values from the source database? Thanks, Guido

Database server connection limit exceeded..

I have an SSIS package and have been adding additional DFTs to it.  Where there are dependencies between transformations I identify them.  However where things can procceed in parallel I do not constrain them form a control flow standpoint.  After adding another DFT I am now getting package failure due to "Database server connection limit exceeded" (my local source database is SQL Anywhere and it has a max connections of 10 in production it will be full blown Sybase and will probably not be so constrained).  I think I can solve the problem just my making control flow dependencies to reduce the amount of parallel activity but I am wondering if there are other things I should consider doing.  For instance are there other settings I can tweak that tell SSIS to run parallel up to X connections out of a connection pool? (or something like that). Some may comment that this relates to my post of yesterday on package strategy (master-child packages or one big package).  I still have one big package for now but may break it into master-child.  Still I think I can control the amount of parallel activities through control flow even if it remains one package. Any thoughts or comments on this would be appreciated. - Charles PS - just ran my package and this time it succeeded - sometimes I hit the limit of 10 connections sometimes not...

Database connection problem in ASP.NET

Hello,            I m having a database problem that I couldnt identify. The IIS loses connection to database once in 3 weeks.  Once  you restart the IIS everything is normal. Looks like IIS is fine because i can go to static pages. When I go to a page that requires database connection I get this error: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - Either the application has not called WSAStartup, or WSAStartup failed. 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)   Is this a connection string problem?. because without changing anything if I restart the webserver all is fine.  Is this a problem with application state?   It cant be at the sql server side as other applications on the machine work fine. There is something going on with IIS not sure what it is.   Any help would be appreiciated.   Thanks, Bharani      

help needed re: "Invalid Database Connection"

I'm a novice at adding programs. I have Windows XP, & have tried downloading a homeschool program, but when I click on the icon on the desktop I get this message in a pop-up box: "Invalid Database Connection X Cannot Establish A Valid Database Connection / Exception message: Login failed for user 'soshome09.' Reason: Server is in single user mode. Only one administrator can connect at this time. / Please contact technical support"   *Note: the user 'soshome09' is the homeschool disk I'm trying to open. I don't even know if I'm posting this request in the right area/forum!!!! ANY/All help will be greatly appreciated! thesingingbyrds@hotmail.com

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."    

SQL Database Connection Timeout

How do you modify the default 15 second timeout Connection Timeout on SQL databases in SQL 2005, for all users? I am able to modify the value on an individual basis through the options menu on the SQL Server 2005 login window however when signing on as a different user the changes do not carry to that users profile.

How to create a connection to Access Database

Hi guys, I want to create a report from Access Database. Can anybody tell me how to connect and create a data source from Access data source. A step by step guide is preferable. I am more concerned on the connection string. Thanks.

2-Way Connection between SharePoint List and SQL Database?

We currently have a SQL database with an Access front-end.  It's clunky and everyone hates it, of course.  Is there a reasonably simple way to tie a SharePoint list to a table in the database so that items can be entered in the SharePoint List and show up in the database, and vice-versa?  The reason for keeping the database is that some data is entered by users in Access, but some comes from an external source - thus, the need for a 2-way connection. It's MOSS 2007.

Database connection error

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!

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.

how to change the web application Database connection form Windows authentication to SQL Server acco

Hi, I have a web application created and Database connection authentication was given as Windows authentication. how can i change it to a SQL server account in MOSS 2007. Thanks in advance.
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