Dear All,
1. I have added an entry in web.config for sql connection string as below
<add key="KPISqlCS" value="XXXXXXXXXXXXXXXXXXXXXXXXXX++E4IO+Fc9m4E7UUrNFxwQ6EOmbrf6AHuUjM6CIVqMnJH/NiiGlgYuyyIj03WI978HbERHI4+ctlTNMZD3Ave/oGXGP6u24Tmw==" />
<add key="EncryptionKey" value="GSra2000" />
2. In visual stuido "appconfiguration.cs", i have written the below
public static string KPISqlEntityCS
{
get
{
string constr = ConfigurationManager.AppSettings["KPISqlCS"];
if (!string.IsNullOrEmpty(constr))
constr = new SecureAccessComponent.clsEncryption64().DecryptFromBase64String(constr, EncryptionKey);
string conStrIntegratedSecurity = new System.Data.EntityClient.EntityConnectionStringBuilder
{
Metadata = "res://*",
Provider = "System.Data.EntityClient", //i have tested with enityclient and sqlclient
any one of these two
Provider = "System.Data.SqlClient",
ProviderConnectionString = constr,
}.ConnectionString;
return conStrIntegratedSecurity;
}
}
3. To get this sql connection string, i have written the below.
public static string GetSQLConnectionString(){
A. string strConnectionString = "Data Source=ENAZSQLRSA;Initial Catalog =ENOCSSC_KPI;Integrated Security = true";
B. string strConnectionString=AppConfiguration.KPISqlEntityCS;
return strConnectionString;
}
in step 3, if i use A, i do not get any error, if i use B, i get the error "Error occurred, please contact the system administrator, keyword not supported - metadata"
Help would be highly appreciated.
Thanks in advance.
Thanks Ramanjjilu Naidu