custom tag for database

jowy
2007-03-01
2014-07-05
  • jowy
    jowy
    2007-03-01

    Hi Nicholas

    I got a problem with custom tag
    Can I use a database in a custom tag?
       I write some code as custom tag but the bot cannot recognize that custom tag
      
       namespace TambahTag
       {
           [CustomTag]
           public class srcbahan : AIMLTagHandler
           {
               public srcbahan()
               {
                   this.inputString = "srcbahan";
               }
               protected override string ProcessChange()
               {
                   if (this.templateNode.Name.ToLower() == "srcbahan")
                   {
                       String bahancari = this.templateNode.InnerText;
                       OleDbConnection con = new OleDbConnection(TambahTag.Properties.Settings.Default.dbresepConnectionString);
                       OleDbDataAdapter adpt = new OleDbDataAdapter("SELECT namamasakan FROM masakan, mixbahan WHERE namabahan = " + bahancari + " AND masakan.idresep=mixbahan.idresep", con);
                       DataSet msk = new DataSet();
      
                       adpt.Fill(msk, "masakan");
      
                       String namamasakan = String.Empty;
      
                       foreach (DataRow r in msk.Tables["masakan"].Rows)
                       {
                           namamasakan = "" + r["namamasakan"] + Environment.NewLine;
                       }
                       return namamasakan;        
                  }
                   return String.Empty;
               }
           }
       }

    Any idea??

      thanks
      jo

     
    • Jo,

      I'll try to reproduce this problem and get back to you.

      Best wishes,

      Nicholas

       
  • Mohammed Owais
    Mohammed Owais
    2014-07-05

    Well i am new to AIML. I have loaded the custom Tag DLL.. How to call it in the AIMLGUI Sample..when i send a request it just says irrelevant answer.. I tried the testtag Tag which did not give an answer.

    HOW TO CALL CUSTOM TAG?

     
    Last edit: Mohammed Owais 2014-07-05
    Attachments