private void btnKitapGeriDon_Click(object sender, EventArgs e) { Kitap kitap = new Kitap(); kitap.Show(); this.Close(); }
private void btnExceldenAktar_Click(object sender, EventArgs e) { if (baglanti.baglan.State == ConnectionState.Closed) { baglanti.baglan.Open(); } openFileDialog1.ShowDialog(); txtUzanti.Text = openFileDialog1.FileName; string dosya_yolu = openFileDialog1.FileName; OleDbConnection deneme = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source = " + dosya_yolu + "; Extended Properties = Excel 12.0"); deneme.Open(); string sorgu = "select * from [Kitaplar$] "; OleDbDataAdapter data_adaptor = new OleDbDataAdapter(sorgu, deneme); deneme.Close(); DataTable dt = new DataTable(); data_adaptor.Fill(dt); gridKitap.DataSource = dt; for (int i = 0; i < dt.Rows.Count; i++) { string cumle = "INSERT INTO KITAP VALUES(KITAP_ID_SEQ.NEXTVAL,'" + gridKitap.Rows[i].Cells["AD"].Value + "','" + gridKitap.Rows[i].Cells["YAZAR"].Value + "'," + gridKitap.Rows[i].Cells["SAYFA_SAYISI"].Value + ",'" + gridKitap.Rows[i].Cells["YAYIN_EVI"].Value + "','" + gridKitap.Rows[i].Cells["TUR"].Value + "',1)"; OracleCommand komut = new OracleCommand(cumle, baglanti.baglan); komut.ExecuteNonQuery(); } MessageBox.Show("Yükleme İşlemi başarılı", "Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); Kitap kitap = new Kitap(); kitap.Show(); }
private void btnKitap_Click(object sender, EventArgs e) { Kitap kitap = new Kitap(); kitap.Show(); }