Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabase created in SQL Server Management Studios cannot be found by Visual Studio 2010
    text
    copied!<p>I created a new database (<code>AC_2012</code>) on my localhost in SQL Server 2008 Management Studio. </p> <p>I'm trying to connect it via connection string in <code>web.config</code> in Visual Studio 2010 Premium. It won't pick it up.</p> <pre><code>&lt;configuration&gt; &lt;configSections&gt; &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt; &lt;/configSections&gt; &lt;system.web&gt; &lt;compilation debug="true" targetFramework="4.0" /&gt; &lt;/system.web&gt; &lt;connectionStrings&gt; &lt;add name="AC_2012" connectionString="server=.\SQLEXPRESS;database=AC_2012; integrated security=True;" providerName="System.Data.SqlClient" /&gt; &lt;/connectionStrings&gt; &lt;/configuration&gt; </code></pre> <p>And here's how I'm trying to call the connection string.. yes it isn't finished.. </p> <pre><code>public static void storedProcedure(string[] paramName, string[] paramValue, string sproc) { SqlConnection conn = null; SqlDataReader reader = null; try { string connStr = ConfigurationManager.ConnectionStrings["AC_2012"].ConnectionString; conn = new SqlConnection(connStr); reader = new SqlDataReader(); DataTable dt = new DataTable(); conn.Open(); SqlCommand cmd = new SqlCommand(sproc, conn); for (int x = 0; x &lt; paramName.Count(); x++) { cmd.Parameters.Add(new SqlParameter(paramName[x], paramValue[x])); } reader = cmd.ExecuteReader(); while (reader.Read()) { } } catch (Exception e) ... </code></pre>
 

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