asp.net de veri ekleme de sırun oluyor..

Kodla Büyü

hhaktan

Site Gezgini
Mesajlar
31
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.OleDb;

public partial class _Default : System.Web.UI.Page
{
OleDbConnection calisan;
void getir()
{
calisan.Open();
OleDbCommand cagir = new OleDbCommand("select * from calisan", calisan);
OleDbDataReader veri = cagir.ExecuteReader();
GVliste.DataSource = veri;
GVliste.DataBind();
calisan.Close();

}

protected void Page_Load(object sender, EventArgs e)
{

string constr = "Provider = Microstf.Jet.OLEDB.4.0;Data Source=" + Server .MapPath ("App_Data/calisan.mdb") +";";
calisan =new OleDbConnection (constr );
getir ();
}
protected void BtnEkle_Click(object sender, EventArgs e)
{
calisan.Open();
string hesapla;
int calisan_gun, gunluk_ucret, toplam;
calisan_gun = Convert.ToInt32(TextBox3.Text);
gunluk_ucret = Convert.ToInt32(TextBox4.Text);
toplam = calisan_gun * gunluk_ucret;
TextBox5.Text = toplam.ToString();
hesapla = "insert into calisan(Sirket_Id,Ad_Soyad,c_gun,g_ucret,toplam) values (@Sirket_Id,@Ad_Soyad,@c_gun,@g_ucret,@toplam)";
OleDbCommand cagir = new OleDbCommand(hesapla, calisan);
cagir.Parameters.Add("Sirket_Id", TextBox1.Text);
cagir.Parameters.Add("Ad_Soyad", TextBox2.Text);
cagir.Parameters.Add("c_gun", TextBox3.Text);
cagir.Parameters.Add("g_ucret", TextBox4.Text);
cagir.Parameters.Add("Toplam", TextBox5.Text);
cagir.ExecuteNonQuery();
calisan.Close();
getir();
}
}
kodlarım bunlar
hata mesajımda
'Microstf.Jet.OLEDB.4.0' sağlayıcısı yerel makine kayıtlı değil. bu mesajı verirken calisan.open() satırını gösteriyor.
 
Geri
Üst