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 :
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 :
Anas MoukiPosted Oct 5, 2018, 9:51 AM
Udit ChauhanPosted Oct 5, 2018, 9:42 AM