title: Getting run time error as "Must declare scalar variable @name"
body: <p>I am getting run time error as "Must declare scalar variable @name"</p>
  
  <pre><code>public partial class UserMainPage : System.Web.UI.Page
  {
      string strConnString = ConfigurationManager.ConnectionStrings["FindConnectionString"].ConnectionString;
      string str;
      SqlCommand com;
  
      protected void Page_Load(object sender, EventArgs e)
      {
         label1.Text = Session["name"].ToString();
         string name = label1.Text;
         SqlConnection con = new SqlConnection(strConnString);
         con.Open();
         str = "select balanceamount from wallet where username LIKE '%'+@name+'%'";
  
         com = new SqlCommand(str, con);
         SqlDataReader reader = com.ExecuteReader();
         reader.Read();
         walletbalance.Text = reader["balanceamount"].ToString();
         reader.Close();
         con.Close();
      }
  }
  </code></pre>