title: Search By Name in c#
body: <p>I have the Follwing Code. To search by StdName but when i run this code it shows empty cells in datagrid view. Help me to correct this.</p>
  
  <pre><code> private void btnSBN_Click(object sender, EventArgs e)
      {
          String query = "Select * from Student where StdName like '*@Name*'";
  
          OleDbCommand cmd = new OleDbCommand(query, cn);
          cmd.Parameters.Add("@Name", OleDbType.VarChar, 20);
          cmd.Parameters["@Name"].Value = txtName.Text;
          OleDbDataAdapter da = new OleDbDataAdapter();
          da.SelectCommand = cmd;
  
          try
          {
              DataSet ds = new DataSet();
              da.Fill(ds,"SBN");
              dgStudent.DataSource = ds;
              dgStudent.DataMember = "SBN";
              dgStudent.Refresh();
          }
          catch (OleDbException ex)
          {
              MessageBox.Show(ex.Message);
          }
  
  
      }
  </code></pre>
  
  <p>Compiler shows no syntax error and no exceptions. but show empty cells in datagrid view.</p>