public string GetData()
{
try
{
SqlConnection sqlConnection =
new SqlConnection(
"Data Source=127.0.0.1;Initial Catalog=SalesERPDB;Integrated Security=True;User Id=sa;Password=123456");
sqlConnection.Open();
SqlCommand sqlCommand = new SqlCommand();
sqlCommand.Connection = sqlConnection;
sqlCommand.CommandType = CommandType.Text;
sqlCommand.CommandText = "select FirstName from TblEmployee";
return sqlCommand.ExecuteScalar().ToString();
}
catch (Exception ex)
{
return ex.ToString();
}
}