private void button1_Click(object sender, EventArgs e) { File.Copy(temp1, @"C:\Users\Tomal\Documents\Visual Studio 2013\Projects\Info\AllInfo\gif\" + textBox1.Text + ".gif"); vdoDataContext d1 = new vdoDataContext(); gif gf = new gif(); gf.Name = textBox1.Text; gf.Type = textBox2.Text; d1.gifs.InsertOnSubmit(gf); d1.SubmitChanges(); MessageBox.Show("gif is added successfully. Thank you"); textBox1.Text = null; textBox2.Text = null; textBox3.Text = null; }
private void button1_Click(object sender, EventArgs e) { try { using (vdoDataContext data = new vdoDataContext()) { gif giffiles = data.gifs.Single(gif => gif.Name == textBox1.Text); name = giffiles.Name; MessageBox.Show("gif is available"); } } catch { MessageBox.Show("gif is notavailable"); textBox1.Text = null; } }
partial void Deletegif(gif instance);
partial void Updategif(gif instance);
partial void Insertgif(gif instance);