Note that there are some explanatory texts on larger screens.

plurals
  1. POError in setting up the connection
    primarykey
    data
    text
    <p>What is wrong with my code? When Im setting up the connection between my sql and asp, it gives me this error : the sqlcommand cannot be found. Are you missing...."</p> <p>Here is my code.</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.Sql; protected void Button2_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ConnectionString); SqlCommand cmd = new SqlCommand("Insert into CarTab( Brand,Model,Plate,Color,Service) Values (@brand,@model,@plate,@color,@year,@service)",conn); cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue("@brand", Label1.Text); cmd.Parameters.AddWithValue("@model", Label2.Text); cmd.Parameters.AddWithValue("@plate", Label3.Text); cmd.Parameters.AddWithValue("@color", Label4.Text); cmd.Parameters.AddWithValue("@year", Label5.Text); cmd.Parameters.AddWithValue("@service", Label6.Text); conn.Open(); cmd.ExecuteNonQuery(); } </code></pre> <p>I've already put Using system.data; and Using system.data.sql; but it still the same. Error : 1.The type or namespace name 'SqlConnection' could not be found (are you missing a using directive or an assembly reference?) 2.The type or namespace name 'SqlConnection' could not be found (are you missing a using directive or an assembly reference?) 3.The name 'ConfigurationManager' does not exist in the current context 4.The type or namespace name 'SqlCommand' could not be found (are you missing a using directive or an assembly reference?) 5.The type or namespace name 'SqlCommand' could not be found (are you missing a using directive or an assembly reference?)</p> <p>Hope this help you in finding solution for my errors. Thanks</p>
    singulars
    1. This table or related slice is empty.
    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