as per discussion in solution-2,
connection string is wrong.
sql connection string should be like below,
if sql server have
Windows authentication Mode
"data source=ServerName; Initial Catalog=DatabaseName; Integrated security=true;"
if sql server have
SQL authentication Mode
"data source=ServerName; Initial Catalog=DatabaseName; Uid=SQLServerLoginId;pwd=SQLServerPassword;"
Happy Coding!
:)