private void button2_Click(object sender, EventArgs e) { File.Copy(temp1, @"C:\Users\Tomal\Documents\Visual Studio 2013\Projects\Info\AllInfo\tutorial\" + textBox1.Text + ".mp4"); vdoDataContext d1 = new vdoDataContext(); videotutorial v = new videotutorial(); v.Name = textBox1.Text + ".mp4"; v.Type = textBox2.Text; d1.videotutorials.InsertOnSubmit(v); d1.SubmitChanges(); MessageBox.Show("tutorial is added successfully. Thank you"); textBox1.Text = null; textBox2.Text = null; textBox3.Text = null; }
private void button2_Click(object sender, EventArgs e) { try { using (vdoDataContext data = new vdoDataContext()) { videotutorial vdt = data.videotutorials.Single(videotutorial => videotutorial.Name == textBox1.Text + ".mp4"); name = vdt.Name; MessageBox.Show("Tutorial is available"); } } catch { MessageBox.Show("Tutorial is not available "); textBox1.Text = null; } }
partial void Deletevideotutorial(videotutorial instance);
partial void Updatevideotutorial(videotutorial instance);
partial void Insertvideotutorial(videotutorial instance);