i have a list of items within a repeater and im trying to get the index of each item after clicking a button and inserting the data into another table.i tried almost everything but cant find how to make it possible. the code below is the one i used to retrieve the data from the db and display it on the repeater :
Code
protected void Page_Load(object sender, EventArgs e)Code
{Code
con.Open();Code
SqlCommand cmd = con.CreateCommand();Code
cmd.CommandType = CommandType.Text;Code
cmd.CommandText = "select caract, image_Ter, taille, info from Terrain";Code
cmd.ExecuteNonQuery();Code
DataTable dt = new DataTable();Code
SqlDataAdapter da = new SqlDataAdapter(cmd);Code
da.Fill(dt);Code
temp.DataSource = dt;Code
temp.DataBind();Code
con.Close();Code
}Code
and heres the button that i want it to get the index and insert the data into another table :Code

Udit ChauhanRank #3,035 · 475 reputationPosted Oct 5, 2018, 5:42 AM EDT
Anas Mouki9 reputationPosted Oct 5, 2018, 5:51 AM EDT