protected void Page_Load(object sender, EventArgs e)
{
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select caract, image_Ter, taille, info from Terrain";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
temp.DataSource = dt;
temp.DataBind();
con.Close();
}
and heres the button that i want it to get the index and insert the data into another table :
<asp:Button class="btn btn-secondary btn-xl" data-dismiss="modal" runat="server" ID="choice" Text="Add" />