Click here to Skip to main content
15,899,475 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi Team

I am new to asp.net could you please help me to solve the below issue
This is my web.config for connection string
XML
<connectionStrings>
    <add name="InvoiceConnectionString" connectionString="DataSource=.\SQLEXPRESS;AttachDbFilename=C:\Inetpub\wwwroot\Invoice\App_Data\Database2.mdf;Integrated Security=True;ConnectTimeout=30;UserInstance=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>


i am getting error Keyword not supported: 'datasource'.

Thanks

Regards
Lancy
Posted
Comments
Dharmendhar Jarwani 31-Jul-22 11:39am    
In my case double space was added between Data and Source

Use
.....connectionString="Data Source=.\SQLEXPRESS;....."
Add a space in between Data and Source.

See Connection strings for SQL Server 2008[^].
 
Share this answer
 
v3
Comments
Mehdi Gholam 28-Oct-11 4:46am    
5'ed
André Kraak 28-Oct-11 4:47am    
Thanks.
Toniyo Jackson 28-Oct-11 4:50am    
Correct, 5!
Uday P.Singh 11-Nov-11 1:35am    
5ed :)
try giving space between Data and Source as

Data Source=xxx;
 
Share this answer
 
Comments
Member 11223037 25-Nov-14 2:01am    
Data Source=(LocalDB)\v11.0; AttachDbFilename=|DataDirectory|\\BookShop.mdf;Integrated Security=True;ProviderName=System.Data.SqlClient"

but showing keyword not supported:'providername'
nivas.malli 23-Aug-16 4:56am    
Hi All,
I am using OracleConnection in C# application. i am getting error while using Connection Timeout in Connection String. Please help on this.

"Invalid Keyword connection timeout"

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