using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Demo
{
public class ApplicationGenral
{
internal string ConnectionStr()
{
System.Configuration.Configuration rootWebConfig =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/DemoApp");
System.Configuration.ConnectionStringSettings connString;
if (rootWebConfig.ConnectionStrings.ConnectionStrings.Count > 0)
{
connString = rootWebConfig.ConnectionStrings.ConnectionStrings["AuthDemo"];
if (connString != null)
return connString.ConnectionString;
else
return "";
}
else
{
return "";
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Demo
{
public class ApplicationGenral
{
internal string ConnectionStr()
{
System.Configuration.Configuration rootWebConfig =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/DemoApp");
System.Configuration.ConnectionStringSettings connString;
if (rootWebConfig.ConnectionStrings.ConnectionStrings.Count > 0)
{
connString = rootWebConfig.ConnectionStrings.ConnectionStrings["AuthDemo"];
if (connString != null)
return connString.ConnectionString;
else
return "";
}
else
{
return "";
}
}
}
}
No comments:
Post a Comment