Beispiel #1
0
        public override IList <ProceduresSchema> GetProcedures(System.Data.Common.DbConnectionStringBuilder connectionstr)
        {
            IList <ProceduresSchema> list = null;

            using (MySqlConnection connection = new MySqlConnection(connectionstr.ConnectionString))
            {
                connection.Open();
                DataTable procedures = connection.GetSchema(SqlClientMetaDataCollectionNames.Procedures, new string[] { null, null, null, "PROCEDURE" });
                if (procedures != null && procedures.Rows.Count > 0)
                {
                    list = new List <ProceduresSchema>();
                    foreach (DataRow procedure in procedures.Rows)
                    {
                        string           name = string.Format("{0}", procedure["SPECIFIC_NAME"]);
                        string           des  = string.Format("{0}.{1}", procedure["ROUTINE_SCHEMA"], procedure["SPECIFIC_NAME"]);
                        ProceduresSchema proc = new ProceduresSchema(name, des);
                        list.Add(proc);
                    }
                }
            }
            return(list);
        }
Beispiel #2
0
 public override IList<ProceduresSchema> GetProcedures(System.Data.Common.DbConnectionStringBuilder connectionstr)
 {
     IList<ProceduresSchema> list = null;
     using (MySqlConnection connection = new MySqlConnection(connectionstr.ConnectionString))
     {
         connection.Open();
         DataTable procedures = connection.GetSchema(SqlClientMetaDataCollectionNames.Procedures, new string[] { null, null, null, "PROCEDURE" });
         if (procedures != null && procedures.Rows.Count > 0)
         {
             list = new List<ProceduresSchema>();
             foreach (DataRow procedure in procedures.Rows)
             {
                 string name = string.Format("{0}",procedure["SPECIFIC_NAME"]);
                 string des = string.Format("{0}.{1}", procedure["ROUTINE_SCHEMA"], procedure["SPECIFIC_NAME"]);
                 ProceduresSchema proc = new ProceduresSchema(name,des);
                 list.Add(proc);
             }
         }
     }
     return list;
 }