C# ile mysql verilerini alma
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
dbMysql.cs
hesapGrid.cs

README.md

Connection

Server, database, user, password set:

public partial class Form1 : Form
    {
        public dbMysql DB;
        public Form1()
        {
            InitializeComponent();
            DB = new dbMysql();
            DB.configSet("Server", Properties.Settings.Default["dbhost"].ToString())
                .configSet("database", Properties.Settings.Default["dbtable"].ToString())
                .configSet("user", Properties.Settings.Default["dbuser"].ToString())
                .configSet("password", Properties.Settings.Default["dbpass"].ToString())
                .dbaseSet();
        }
    }

Command

Select:

DataTable dbArr = this.setSql("SELECT * FROM tableName").runSql().getAll();

Command

Select:

DataTable dbArr = this.setSql("SELECT * FROM tableName WHERE id = @id").setArg("id","5").runSql().getAll();

Command

Select:

DataTable dbArr = this.setSql("SELECT * FROM tableName WHERE ctype = @ctype AND status = @status ").setArg("ctype","obj").setArg("status","live").runSql().getAll();

Command

Select: Dictionary

Dictionary<string, string> Args = new Dictionary<string, string>();
Args.Add("ctype", "obj");
Args.Add("status", "live");

DataTable dbArr = this.setSql("SELECT * FROM tableName WHERE ctype = @ctype AND status = @status ").setArg(Args).runSql().getAll();