title: Asp.net how to correct the error
body: <pre><code> using System;
   using System.Collections;
   using System.Configuration;
   using System.Data;
   using System.Linq;
   using System.Web;
   using System.Web.Security;
   using System.Web.UI;
   using System.Web.UI.HtmlControls;
   using System.Web.UI.WebControls;
   using System.Web.UI.WebControls.WebParts;
   using System.Xml.Linq;
   using System.Data.SqlClient;
  
   public partial class Bookcheck : System.Web.UI.Page
    {
  
      protected void Page_Load(object sender, EventArgs e)
      {
  
      }
      protected void Button1_Click(object sender, EventArgs e)
      {
          SqlDataAdapter da=new SqlDataAdapter ();
          SqlConnection cnn=new SqlConnection();
          DataSet ds = new DataSet();
          string constr = null;
          SqlCommand cmd = new SqlCommand();
          if (IsValid != null)
          {
              constr = @"Data Source=DEVI\SQLEXPRESS; Initial Catalog =librarymanagement; 
   Integrated Security=SSPI";
              cnn.ConnectionString = constr;
              try
              {
                  if (cnn.State != ConnectionState.Open)
                      cnn.Open();
              }
              catch (Exception ex)
              {
                  string str1 = null;
                  str1 = ex.ToString();
              }
              cmd.Connection = cnn ;
  
              cmd.CommandType = CommandType.StoredProcedure;
              cmd.CommandText  = "spbookcheck";
              cmd.Parameters.Clear();
              cmd.Parameters.AddWithValue("bookid", txtid.Text);
              cmd.Parameters.AddWithValue("Nameofthebook", txtnb.Text);
              da.SelectCommand=cmd;
              try
              {
                  da.Fill(ds);
              }
              catch (Exception ex)
              {
  
                  string strErrMsg = ex.Message;
                  // throw new ApplicationException
              }
              finally
              {
                  da.Dispose();
                  cmd.Dispose();
                  cnn.Close();
                  cnn.Dispose();
              }
              if (ds.Tables[0].Rows.Count &gt; 0)
              {
                  Msg.Text = "bookcheck successfully";
                  Response.Redirect("Issueofbook.aspx");
              }
              else
              {
                  Msg.Text="bookcheck failed";
              }
          }
  
  
  
      }
  
   }
  </code></pre>
  
  <p>My error          </p>
  
  <blockquote>
    <p>Index out of range exception the unhandle by the user cannot find
    table 0</p>
  </blockquote>