473,503 Members | 6,385 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

showing Instance failure when executing connection string in ASP.net (C#)

5 New Member
am already set a connection string in web config file as

Expand|Select|Wrap|Line Numbers
  1. <connectionStrings>
  2.         <add name="con" connectionString="Data Source=ashii\\sqlexpress;Initial Catalog=test;Integrated Security=SSPI" providerName="System.Data.SqlClient"/>
  3.     </connectionStrings> 
and try to access in code as
Expand|Select|Wrap|Line Numbers
  1.  SqlConnection con1=new SqlConnection (System.Configuration.ConfigurationManager.ConnectionStrings["con"].ConnectionString);
  2.  
  3.         con1.Open();
from ths step result is instance failure .How can i solve this
Jan 11 '13 #1
5 4707
PsychoCoder
465 Recognized Expert Moderator Contributor
It sure would help if we knew the exact error message you're getting. I could take a guess but it would be easier if you let us know exactly what it says :)
Jan 11 '13 #2
sangituttu
5 New Member
its instance failure at the step Con1.open();
Jan 12 '13 #3
adriancs
122 New Member
Yes, we know where it stopped.
what is the Error Message? Exception Message?
Jan 14 '13 #4
monukumar
1 New Member
yes, it shows the exception error which shows the "Instance failure"
Oct 4 '14 #5
Frinavale
9,735 Recognized Expert Moderator Expert
With no description about what type of exception you are getting the only thing that I can suggest is:

Please ensure that your connection string is correct.

For more information about connection strings please see this MSDN article about Connection String Syntax.

-Frinny
Oct 7 '14 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

17
3216
by: AMC | last post by:
Hi, I'm using an include file to store the connection string to a database. Whenever I try to reference that string to open a connection in the page that includes the file I get the error 'empy...
4
2422
by: msnews.microsoft.com | last post by:
How can I call connection string (database) builder dialog?
11
2854
by: Bob | last post by:
In our new .NET web applications, we try to limit the use of SqlConnection to just one instance per page, even if there are multiple accesses to various queries. The thinking behind is that this...
2
3852
by: aarepasky | last post by:
Using ASP 2.0 express VB code to connect to a SQL Server express DB I get an Instance failure, but doing the same thing with C# it works. The error is on the open. Here is the code: Imports...
2
2396
by: Steven Blair | last post by:
Hi, My web application was poitning to a cal instance of Sql 2005. Connection string setup in the web.config and is working fine. I know need it to point to a security Database on a remote Sql...
5
7688
by: OJ | last post by:
Hi, I am at a loss here, I have a c# asp.net website which connects to a remote SQL Server 2000 db via a connection string. If I set the website up in the filesystem and use the inbuilt cassini...
13
2828
by: Jennifer.Berube | last post by:
well I'm not sure how to go about making my SQL connection string... The code below is what I need to replace with my SQL connection...I just don't know if that code is for DSN or access... I...
1
2599
by: dellis | last post by:
Problem: My project was initially created without putting passwords in the connection string. When I added the password in the connection string, it disappears when performing a database fill. I...
1
2054
by: Manish | last post by:
Hi i have a problem where as i want to use two different C# net program in a single system where i have used 2 different sql server name. when i execute those program each time iam renaming the...
6
6413
by: little83 | last post by:
Dear all i wrote one class to deal with sql database to insert and read data from that class only...and based on that one of the parmeters or the class is the sqlconnection SqlConnection...
0
7070
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.