Note that there are some explanatory texts on larger screens.

plurals
  1. POtrying to find error of the connection string to external sql server
    primarykey
    data
    text
    <p>iam running asp.mvs web-application. its already hosted and DB is also by same hosting provider. i am trying (already 3 day) to use given <code>connection string</code> for transfering data from DB. here is my method where is my <code>connection string.</code> can you please take a look and see some potential mistake. its very annoing because i cant do this simple thing.</p> <pre><code> /// &lt;summary&gt; /// Gets connection string of Database /// &lt;/summary&gt; /// &lt;returns&gt;connection string of type const&lt;/returns&gt; public static string GetConnectionStringOfDatabase() { try { string cnc = @"data source=OnlineVertrag.mssql.somee.com;workstation id=OnlineVertrag.mssql.somee.com;packet size=4096;user id="xxx";pwd="xxx";persist security info=False;initial catalog=OnlineVertrag"; return cnc; } catch (Exception ex) { bool rethrow = ExceptionHelper.Handle(ex, "Business Logic"); if (rethrow) { throw; } } return null; } public bool CheckIfUserIsActive(string username) { SqlConnection connection = new SqlConnection(SQLDataHelper.GetConnectionStringOfDatabase()); try { connection.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = connection; cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = @"SELECT IsActive " + "FROM Users " + "WHERE Username = @Username"; cmd.Parameters.Add(new SqlParameter("@Username", UserName)); SqlDataReader reader = cmd.ExecuteReader(); bool isActiveValueFromDataBase = false; if (reader.HasRows) { while (reader.Read()) { isActiveValueFromDataBase = Convert.ToBoolean(reader["IsActive"]); if (isActiveValueFromDataBase == true) { return true; } return false; } } reader.Close(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload