using System;using System. Collections. Generic;using System. Linq;using System. Text;namespace Get_Data{ using System; using System. Collections. Generic; using System. Text; using System. Data; using System. Data. SqlClient; using System. Configuration; public class DBClass { private static DBClass defaultInsatance = new DBClass ; public static DBClass Default { get } public DBClass public bool InsertCommand { SqlConnection cnn = new SqlConnection ; try catch try catch return true; } public bool UpdateCommand { SqlConnection cnn = new SqlConnection ; try catch try catch return true; } public DataSet SelectCommand { SqlConnection cnn = new SqlConnection ; try catch try catch finally } public bool DeleteCommand { SqlConnection cnn = new SqlConnection ; try catch try catch return true; } public bool ExecuteCommand { SqlConnection cnn = new SqlConnection ; try catch try catch return true; } string connectionStr; } } / Kullanım query = "SELECT from y..."; DataSet xSet = DBClass. Default. SelectCommand ; string str = xSet. Tables . Rows ; / Bütün mesajlarım ve konularım BSD Lisansı"yla lisanslanmıştır.

Aslında nett kütüphaneler var fakat ben kendim yazmayı tercih ediyorum. Sürekli kullandığım iki klası sizlerle paylaşmak istedim. Derlemedim isterseniz değiştrirsiniz diye. iki klas dan biri access diğeri sql için. sql de procedure için hazırladım ve addparameters metodunda parametre adı ve value si oledb de ise parametrler '?' işaretine gre hazırlandı. Yani Veri ver = new Veri ; ver. CmdText = "select ftom tablo where id = ?"; ver. AddParameters(1); şeklinde /////////////////////////////////////////////////SQL/////////////////////////////////////////////////// using System;using System. Data;using System. Configuration;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. Collections. Generic;using System. Data. SqlClient; /// <summary>/// cmdexe/// </summary>public class Veri{ private string _Baglanti; public Veri private List<object> Values = new List<object> ; private List<string> Params = new List<string> ; public void AddParameters private SqlConnection _Con; private SqlConnection Con { get } private string _CmdText; public string CmdText { get set } private SqlCommand _Cmd; private SqlCommand Cmd { get { if if (Values. Count > 0) { for (int i = 0; i < Values. Count; i++) } _Cmd. CommandText = _CmdText; return _Cmd; } } public int NonQuery { get } public object Scalar { get } public IDataReader Reader { get } private SqlDataAdapter _Adapter; private SqlDataAdapter Adapter { get } public DataSet Source { get }} ////////////////////////////////////ACCESS///////////////////////////////////////////////////////// using System;using System. Data;using System. Configuration;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. Data. OleDb;using System. Collections. Generic; /// <summary>/// cmdexe/// </summary>public class Veri{ private string _Baglanti; public Veri private List<object> Values = new List<object> ; public void AddParameters private OleDbConnection _Con; private OleDbConnection Con { get } private string _CmdText; public string CmdText { get set } private OleDbCommand _Cmd; private OleDbCommand Cmd { get { if if (Values. Count > 0) { for(int i=0;i<Values. Count;i++) } _Cmd. CommandText = _CmdText; return _Cmd; } } public int NonQuery { get } public object Scalar { get } public IDataReader Reader { get } private OleDbDataAdapter _Adapter; private OleDbDataAdapter Adapter { get } public DataSet Source { get }}