17 Temmuz 2010 Cumartesi

firebird connection nesnesini kullanarak asp.net te veri işleme





merhaba arkadaşlar

firebird connection nesnesini kullanarak asp.net te veri işleme ve listelemeye örnek vermek istiyorum
çünkü şuan çok yaygın larak kullanılan firebird veri tabanı için çok fazla kaynak yok ayrıca
delphiden c# a geçen arkadaşlar içinde uygun bir örnek olacağını düşünüyorum

firebird veri tabanından veriyi çekebilmek için
http://www.firebirdsql.com - www.firebirdsql.com adreisnden ve http://www.dotnetfirebird.com - www.dotnetfirebird.com adresinden .net için provider 'ini indirmelisiniz zaten diğer eklentilerde orada mevcut
connectionstrin oluşturulmuş durumda ve sadece
firebirdsql.data.firebirdsql refaransının nasıl kullanıldığını bu örnekle göstermek istedim





bu konuyla ilgilenen arkadaşlar için

sorcekodlarınıda full gönderebilirim tabi diğer çalışmalarıda
serefkoca@serefkoca.com

default.aspx.cs kodları
----------------------------------------------------------------------------------------------
using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

Panel2.Visible = false;


}

protected void Button1_Click(object sender, EventArgs e)

{

System.Threading.Thread.Sleep(3000);

Panel2.Visible = true;


}

protected void Button2_Click(object sender, EventArgs e)

{

Panel2.Visible = false;


}

protected void Button4_Click(object sender, EventArgs e)

{

FirebirdSql.Data.Firebird.FbConnection BAGLAN =new FirebirdSql.Data.Firebird.FbConnection();

BAGLAN.ConnectionString = ConfigurationManager.ConnectionStrings["netsimgun"].ToString(); // burada web.config dosyasındaki connectionstring i çekiyruz.....

string sorgu="SELECT STOK_ADI,STOK_ID FROM FIRMALAR";


FirebirdSql.Data.Firebird.FbDataAdapter efadap = new FirebirdSql.Data.Firebird.FbDataAdapter(sorgu,BAGLAN);

DataSet ds = new DataSet();

efadap.Fill(ds);

this.GridView1.DataSource = ds.Tables[0];

this.DataBind();


}





protected void Button10_Click(object sender, EventArgs e)

{

FirebirdSql.Data.Firebird.FbConnection BAGLAN = new FirebirdSql.Data.Firebird.FbConnection();

BAGLAN.ConnectionString = ConfigurationManager.ConnectionStrings["netsimgun"].ToString();

//FirebirdSql.Data.Firebird.FbParameter parametre;

string sorgu = "Select F.TURU, TE.STOKO_ADI, TE.DEPO_KODU, TE.SIRKET_KODU, TE.HAREKET_KODU, TE.ATL From STOHR F Join STOKHR T on (F.TNAL = T.TNAL) and (F.TNAL = T.TNAL)Join STODEPO TE on (T.STODEPO_NO = TE.STODEPO)Order By F.STODEPO Asc, F.FSTODEPO_NO Asc";

FirebirdSql.Data.Firebird.FbDataAdapter efadap = new FirebirdSql.Data.Firebird.FbDataAdapter(sorgu, BAGLAN);

DataSet ds = new DataSet();

//parametre = new FirebirdSql.Data.Firebird.FbParameter("@F.TURU", FirebirdSql.Data.Firebird.FbDbType.Char, 50);

efadap.Fill(ds);

this.GridView1.DataSource = ds.Tables[0];

this.DataBind();


}





Hiç yorum yok:

Yorum Gönder