Ejemplo n.º 1
0
                public static DataTable DataTableGetir(string SQL)
                {
                    DataTable DT = new DataTable();

                    try
                    {
                        using (MySqlConnection MySQLCon = Baglanti.BaglantiCumlesi())
                        {
                            using (MySqlCommand MySQLCom = new MySqlCommand(SQL, MySQLCon))
                            {
                                MySQLCon.Open();
                                DT.Load(MySQLCom.ExecuteReader());
                            }
                        }
                    }
                    catch
                    {
                    }

                    return(DT);
                }
Ejemplo n.º 2
0
                public static string ExecuteScalar(string SQL)
                {
                    string sonuc = null;

                    try
                    {
                        using (MySqlConnection MySQLCon = Baglanti.BaglantiCumlesi())
                        {
                            using (MySqlCommand MySQLCom = new MySqlCommand(SQL, MySQLCon))
                            {
                                MySQLCon.Open();
                                sonuc = MySQLCom.ExecuteScalar().ToString();
                            }
                        }
                        return(sonuc);
                    }
                    catch
                    {
                    }
                    return(sonuc);
                }
Ejemplo n.º 3
0
                public static DataSet DataSetGetir(string SQL, string TabloAdi)
                {
                    DataSet DS = new DataSet();

                    try
                    {
                        using (MySqlConnection MySQLCon = Baglanti.BaglantiCumlesi())
                        {
                            using (MySqlCommand MySQLCom = new MySqlCommand(SQL, MySQLCon))
                            {
                                using (MySqlDataAdapter MDA = new MySqlDataAdapter(SQL, MySQLCon))
                                {
                                    MySQLCon.Open();
                                    MDA.Fill(DS, TabloAdi);
                                }
                            }
                        }
                    }
                    catch
                    {
                    }

                    return(DS);
                }