none
Not able to GET_SCHEMA from MYSQL using mysql_ecma2.dll while creating MYSQL_ECMA RRS feed

  • Question

  • i have made a MYSQL_ECMA.dll (using sql_ecma.dll) but when i create that ECMA it is unable to create get_schemafrom my sql

    Database=test

    table=HR

     public Schema GetSchema(KeyedCollection<string, ConfigParameter> configParameters)
            {
                
                Microsoft.MetadirectoryServices.SchemaType personType = Microsoft.MetadirectoryServices.SchemaType.Create("Person", false);
    
                myServer = configParameters["Server"].Value;
                myDB = configParameters["Database"].Value;
                myTable = configParameters["Table"].Value;
    
               DataSet myData = this.MYSQLSchema(myServer, myDB, myTable);
                
                
               
                string[] MYSQLSchema =new string[myData.Tables["Columns"].Rows.Count];
    
                for (int i = 0; i <= myData.Tables["Columns"].Rows.Count - 1; i++)
                {
    
                   
                    MYSQLSchema[i]=myData.Tables["Columns"].Rows[i].ItemArray.GetValue(0).ToString().Trim();
                   
    
                    string myattrib=MYSQLSchema[i];
    
                    if (myattrib == "EmployeeID")
                    {
                        personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattrib, AttributeType.String));
                    }
    
                    else
                    {
                        personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute(myattrib, AttributeType.String));
                    }
    
                }
    
                Schema schema = Schema.Create();
                schema.Types.Add(personType);
    
                return schema;
            }
    
            
    
    
            public DataSet MYSQLSchema(string server,string database, string table)
            {
                myconnectionc =("Server = '" + server + "';Initial Catalog='" + database + "';Integrated Security=True");
                conc =new MySqlConnection(myconnectionc);
                cmdc =new MySqlCommand();
                cmdc.CommandType=CommandType.Text;
                string cmdtextc="Select COLUMN_NAME from Information_Schema.Columns where TABLE_Name = '" + table + "'";
                cmdc.CommandText=cmdtextc;
                cmdc.Connection=conc;
                adapter =new MySqlDataAdapter(cmdc);
                dac =new DataSet();
                adapter.Fill(dac, "Columns");
                return dac;
    
    
                
    
            }
    

    
    
    Wednesday, January 8, 2014 12:36 PM