SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["videoConnectionString"].ConnectionString); private DataTable GetSpecificVideo(object i) { SqlDataAdapter adapter = new SqlDataAdapter("SELECT Video, ID FROM video4 WHERE id = @ID", connection); adapter.SelectCommand.Parameters.Add("@id", SqlDbType.Int).Value = (int)i; DataTable table = new DataTable(); adapter.Fill(table); return table; } protected void Button1_Click(object sender, EventArgs e) { int id = Convert.ToInt32(TextBox1.Text); Repeater1.DataSource = GetSpecificVideo(id); Repeater1.DataBind(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)