How to Add Youtube video



In this post YouTube video Add in asp.net

using System.Data;
using System.Data.SqlClient;

-------------------------------
Save Button Click Coding
-------------------------------

String link = "<embed width = \"500\" height = \"500\" src = \"https://www.youtube.com/embed/" + TextBox2.Text + "\" frameborder=\" 0 \" allowfullscreen></embed>";

String query = "insert into videodetails(videoname,videolink) values('" + TextBox1.Text + "','" + link + "')";
String mycon = "Data Source=sk-pc; Initial Catalog=Harititube; Integrated Security=true";
SqlConnection con = new SqlConnection(mycon);
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = query;
cmd.Connection = con;
cmd.ExecuteNonQuery();
Label3.Text = "Video Has Been Saved";
DataList1.DataBind();

0 Comment's

Comment Form

Submit Comment