title: Cannot find table 0 error in C#
body: <p>I get This error when i try to execute stored procedure and get null dataset.</p>
  
  <pre><code>private SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["learnaspConnectionString"].ConnectionString);
  
  protected void btnregister_Click(object sender, EventArgs e)
  {
          try
          {
              con.Open();
              SqlCommand cmd = new SqlCommand("dbo.RegisterInsert", con);
              cmd.CommandType = CommandType.StoredProcedure;
              SqlParameter p1 = new SqlParameter("@fname", txtfname.Text);
              SqlParameter p2 = new SqlParameter("@lname", txtlname.Text);
              SqlParameter p3 = new SqlParameter("@company", txtcompany.Text);
              SqlParameter p4 = new SqlParameter("@phone", txtphone.Text);
              SqlParameter p5 = new SqlParameter("@address", txtaddress.Text);
              SqlParameter p6 = new SqlParameter("@email", txtemail.Text);
              cmd.Parameters.Add(p1);
              cmd.Parameters.Add(p2);
              cmd.Parameters.Add(p3);
              cmd.Parameters.Add(p4);
              cmd.Parameters.Add(p5);
              cmd.Parameters.Add(p6);
              cmd.ExecuteNonQuery();
  
              con.Close();
              SqlDataAdapter da = new SqlDataAdapter(cmd);
              DataSet ds = new DataSet();
              da.Fill(ds);
              DataTable dt = ds.Tables[0];
              ListViewDetails.DataSource = ds;
              ListViewDetails.DataBind();
              lblmessage.Visible = true;
              lblmessage.Text = "Registration Completed Successfully!";
          }
          catch (SqlException ex)
          {
          }
  }
  </code></pre>
  
  <p>My stored Procedure is:</p>
  
  <pre><code>   CREATE PROCEDURE [dbo].[RegisterInsert] 
      -- Add the parameters for the stored procedure here
      @fname nvarchar(50),
      @lname nvarchar(50),
      @company nvarchar(50),
      @phone nvarchar(50),
      @address nvarchar(250),
      @email  nvarchar(250)   
         SET NOCOUNT ON;
          insert into [dbo].[register]
      ([fname],
       [lname],
       [company],
       [phone],
       [address],
       [email])
       values
       (@fname,
        @lname,
        @company,
        @phone,
        @address,
        @email)    
  END
  </code></pre>
  
  <p>I am not able to get display data in Listview control when i run my code.Button Click event stores values in Database twice and gives error'Cannot find table 0'.</p>
  
  <p>Please help me to let me know where i am wrong in my code.</p>
  
  <p>Thanks in Advance.</p>