Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I am using asp.net,C#,VS 2005,and sql server 2005

I have created a setup file for my web project...

I have also installed IIS in my PC..

I have installed my project ...

my web.config contains the following connection string:

XML
<appSettings/>
    <connectionStrings>
  <add name="conStr" connectionString="DATABASE=CLINICAL;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|CLINICAL.mdf;User Instance=true"
   providerName="System.Data.SqlClient" />

 </connectionStrings>


But when i type http://localhost/WebSetup1/Firstpage.aspx

It will display a page..

But when i click on page that contains connection with the database it is not shown or executed..

It will give error message like Login Failed to KARAN\ASPNET.. when i do click on insert button...

I have installed sql server in my pC.
In short : database connection is not established..

Please help me in this regard.
Thanks in Advance.
regards
karan
Posted
Updated 20-May-11 20:46pm
v2
Comments
Mohd Wasif 21-May-11 2:41am    
You have not placed server name in this connection string
karan joshua 21-May-11 4:27am    
still not working
Mohd Wasif 21-May-11 2:42am    
<appsettings>
<connectionstrings>
<add name="conStr" connectionstring="Data Source=servername;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|CLINICAL.mdf;User Instance=true"
="" providername="System.Data.SqlClient">


1 solution

you can make connection string as below

<connectionStrings>
  <add name="conn" connectionString="Data Source=servername;database=databasename; integrated security=true" />

 </connectionStrings>
 
Share this answer
 
v3
Comments
karan joshua 21-May-11 4:06am    
It will still give exception like:Login Failed to KARAN\ASPNET

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