I'm starting a new C #
But the insert does not work
What could be the problem
The error does not
But it does not insert
But the insert does not work
What could be the problem
The error does not
But it does not insert
C#:
using System;using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace Ole_DB_p1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
OleDbConnection baglanti = new OleDbConnection();
OleDbCommand ekle = new OleDbCommand();
private void button1_Click(object sender, EventArgs e)
{
baglanti.ConnectionString = "provider = Microsoft.jet.Oledb.4.0;Data Source =data.mdb";
baglanti.Open();
ekle = baglanti.CreateCommand();
ekle.CommandText = "Insert Into Tablo(adi,soyadi,bolum) VALUES (@adi,@soyadi,@bolum)";
ekle.Parameters.Add("@adi", textadi);
ekle.Parameters.Add("@soyadi", textsoyadi);
ekle.Parameters.Add("@bolum", textBolum);
{
baglanti.Close();
}
}
private void textadi_TextChanged(object sender, EventArgs e)
{
}
}
}
Last edited by a moderator: