Click here to Skip to main content
16,020,459 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello all,
In my web application,I am having database connectivity on my webpage bussiness
logic section i.e in newproject.aspx.vb page.I want to open connection with
ADODB and i am also having recordset of ADODB.My database is in SQL Server 2008
Enterprise edition.While exicuting the code line for opening the connection
i put the line as below:
con.Open("Provider=SQLNCLI10;" & System.Configuration.ConfigurationManager.AppSettings("strConString"))


My strConString is as follows:
Data Source=PC4-876C2F39454\SQLEXPRESS;Initial Catalog=(name of my database);Integrated Security=True


At that run time it throws the following system exception:
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done


Ihad tried almost several things like following:
1.
con.ConnectionString = "ProviderName = 'System.Data.SqlClient ;' " & System.Configuration.ConfigurationManager.AppSettings("strConString") 
Con.open()

2.
con.ConnectionString = "Driver ={SQL Server Native Client 10.0}; Server =PC4-876C2F39454\SQLEXPRESS; Initial Catalog =proses "
con.open()

3.
con.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("strConString")
con.open()


The same error occurs.How to resolve the problem,becoze the if i work with same connection strings with older versions of SQL server ie.SQLserver2005 and SQL server 2000 it works fine.

So can anybody help me to solve the problem

Thanks in advance
Yogesh
Posted

To find correct connection string for your application, visit connectionstrings.com[^]
 
Share this answer
 
v2
Comments
YOGESH DHAGE 30-Sep-11 3:27am    
What ever connection strings i put in mt quection that i got only from
the website you suggested.....
Thanks For your quick responce.
Try looking at the connection string in VS.
1) Open the Server Explorer pane.
2) If you do not have a connection to your database, create one
2.1) Right click on "Data connections" and select "Add Connection..."
2.2) Follow the dialog instructions.
3) Once you have your connection, highlight the database name and look at the Properties pane.
4) The Connections string is the one that VS is using, and that it knows works. You can copy'n'paste that into your settings, or application directly.

Generally, I use:
C#
using (SqlConnection con = new SqlConnection(myConnectionString))
   {
   con.Open();
   ...
   }
Just to be sure.
 
Share this answer
 
Comments
YOGESH DHAGE 30-Sep-11 3:25am    
Yes Friend Thanks For your quick responce....
what ever procedure you told that procedure i allready follow but it dosent work for me...
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900