Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. XML MySql error

XML MySql error

Scheduled Pinned Locked Moved C#
csharpdatabasehelpmysqlvisual-studio
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Riza Berkay Aycelebi
    wrote on last edited by
    #1

    C# codes is exist below.I am trying to query like in below the codes.I am creating queries via web service using xml.You can see below the codes

    karthareket.kk_no

    colum name when I run this codes visual studio give an error.You can see error below.May you help me? error picture here

    //C# Form

    private void KKTahsilat()
    {
    sql = "SELECT bnisim_ad, kk_adi, cr_adi, DATE_FORMAT(kk_odemetarih,'%d.%m.%Y') AS islemtarih, DATE_FORMAT(bh_tarih,'%d.%m.%Y') AS vadetarih, bh_tutar,bh_tutarbirim, kk_taksitsay, bh_slipdetay as taksit,
    bh_tur, kk_belgeno, kk_tutar FROM tbodeme2017,tbkasa2017, (tbbankahareket2017, tbkredikart2017) LEFT JOIN tbbankakredikartiplan ON (kk_planid=bkp_id)
    LEFT JOIN tbbankakredikartiplantaksit ON (bkpt_planid=bkp_id AND bkpt_taksit=bh_slipdetay), tbcari,tbbankaisim,tbbanka,tbbankakredikarti
    where od_izahat=kk_izahat AND od_satisno=bh_islemno AND ka_islemad=kk_izahat AND ka_stno=bh_islemno AND tbkredikart2017.kk_no=bh_islemno AND cr_no=tbkredikart2017.kk_musno AND bn_bankano = bnisim_id AND bkredikart2017.kk_bankano = bn_id AND tbkredikart2017.kk_posid = tbbankakredikarti.kk_no AND bh_tur LIKE 'Kredi Kartı Tahsilat' ";

            response = veri.exportDataXML(login, sql);
    
            XmlDocument xmlcari = new XmlDocument();
            xmlcari.LoadXml(response);
            XmlNodeList isim = xmlcari.SelectNodes("table/rows/row");
    
            kkTahsilat = 0;
            foreach (XmlNode node in isim)
            {
                kkTahsilat += XmlConvert.ToDouble(node.ChildNodes\[5\].InnerText);
            }
    
        }
    

    //Service Reference
    namespace Livella_Cek.webservis {

    \[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")\]
    \[System.ServiceModel.ServiceContractAttribute(Namespace="urn:WebticariService", ConfigurationName="webservis.WebticariServicePortType")\]
    public interface WebticariServicePortType {
    

    [System.ServiceModel.OperationContractAttribute(Action="urn:WebticariService#exportDataXML", ReplyAction="*")]
    [System.ServiceModel.XmlSerializerFormatAttribute(Style=System.ServiceModel.OperationFormatStyle.Rpc, SupportFaults=true, Use=System.ServiceModel.OperationFormatUse.Encoded)]
    [return: System.ServiceModel.MessageParameterAttribute(Name="return")]
    string exportDataXML(string token, string query);
    }
    public string exportDataXML(string token, string query) {
    return base.Cha

    L P 2 Replies Last reply
    0
    • R Riza Berkay Aycelebi

      C# codes is exist below.I am trying to query like in below the codes.I am creating queries via web service using xml.You can see below the codes

      karthareket.kk_no

      colum name when I run this codes visual studio give an error.You can see error below.May you help me? error picture here

      //C# Form

      private void KKTahsilat()
      {
      sql = "SELECT bnisim_ad, kk_adi, cr_adi, DATE_FORMAT(kk_odemetarih,'%d.%m.%Y') AS islemtarih, DATE_FORMAT(bh_tarih,'%d.%m.%Y') AS vadetarih, bh_tutar,bh_tutarbirim, kk_taksitsay, bh_slipdetay as taksit,
      bh_tur, kk_belgeno, kk_tutar FROM tbodeme2017,tbkasa2017, (tbbankahareket2017, tbkredikart2017) LEFT JOIN tbbankakredikartiplan ON (kk_planid=bkp_id)
      LEFT JOIN tbbankakredikartiplantaksit ON (bkpt_planid=bkp_id AND bkpt_taksit=bh_slipdetay), tbcari,tbbankaisim,tbbanka,tbbankakredikarti
      where od_izahat=kk_izahat AND od_satisno=bh_islemno AND ka_islemad=kk_izahat AND ka_stno=bh_islemno AND tbkredikart2017.kk_no=bh_islemno AND cr_no=tbkredikart2017.kk_musno AND bn_bankano = bnisim_id AND bkredikart2017.kk_bankano = bn_id AND tbkredikart2017.kk_posid = tbbankakredikarti.kk_no AND bh_tur LIKE 'Kredi Kartı Tahsilat' ";

              response = veri.exportDataXML(login, sql);
      
              XmlDocument xmlcari = new XmlDocument();
              xmlcari.LoadXml(response);
              XmlNodeList isim = xmlcari.SelectNodes("table/rows/row");
      
              kkTahsilat = 0;
              foreach (XmlNode node in isim)
              {
                  kkTahsilat += XmlConvert.ToDouble(node.ChildNodes\[5\].InnerText);
              }
      
          }
      

      //Service Reference
      namespace Livella_Cek.webservis {

      \[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")\]
      \[System.ServiceModel.ServiceContractAttribute(Namespace="urn:WebticariService", ConfigurationName="webservis.WebticariServicePortType")\]
      public interface WebticariServicePortType {
      

      [System.ServiceModel.OperationContractAttribute(Action="urn:WebticariService#exportDataXML", ReplyAction="*")]
      [System.ServiceModel.XmlSerializerFormatAttribute(Style=System.ServiceModel.OperationFormatStyle.Rpc, SupportFaults=true, Use=System.ServiceModel.OperationFormatUse.Encoded)]
      [return: System.ServiceModel.MessageParameterAttribute(Name="return")]
      string exportDataXML(string token, string query);
      }
      public string exportDataXML(string token, string query) {
      return base.Cha

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The code you have shown above does not match the code in the error message display.

      R 1 Reply Last reply
      0
      • L Lost User

        The code you have shown above does not match the code in the error message display.

        R Offline
        R Offline
        Riza Berkay Aycelebi
        wrote on last edited by
        #3

        Can you tell why the error was caused by considering the error picture?

        L 1 Reply Last reply
        0
        • R Riza Berkay Aycelebi

          Can you tell why the error was caused by considering the error picture?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Sorry, but I have looked again, and checked the documentation and cannot see what is wrong.

          1 Reply Last reply
          0
          • R Riza Berkay Aycelebi

            C# codes is exist below.I am trying to query like in below the codes.I am creating queries via web service using xml.You can see below the codes

            karthareket.kk_no

            colum name when I run this codes visual studio give an error.You can see error below.May you help me? error picture here

            //C# Form

            private void KKTahsilat()
            {
            sql = "SELECT bnisim_ad, kk_adi, cr_adi, DATE_FORMAT(kk_odemetarih,'%d.%m.%Y') AS islemtarih, DATE_FORMAT(bh_tarih,'%d.%m.%Y') AS vadetarih, bh_tutar,bh_tutarbirim, kk_taksitsay, bh_slipdetay as taksit,
            bh_tur, kk_belgeno, kk_tutar FROM tbodeme2017,tbkasa2017, (tbbankahareket2017, tbkredikart2017) LEFT JOIN tbbankakredikartiplan ON (kk_planid=bkp_id)
            LEFT JOIN tbbankakredikartiplantaksit ON (bkpt_planid=bkp_id AND bkpt_taksit=bh_slipdetay), tbcari,tbbankaisim,tbbanka,tbbankakredikarti
            where od_izahat=kk_izahat AND od_satisno=bh_islemno AND ka_islemad=kk_izahat AND ka_stno=bh_islemno AND tbkredikart2017.kk_no=bh_islemno AND cr_no=tbkredikart2017.kk_musno AND bn_bankano = bnisim_id AND bkredikart2017.kk_bankano = bn_id AND tbkredikart2017.kk_posid = tbbankakredikarti.kk_no AND bh_tur LIKE 'Kredi Kartı Tahsilat' ";

                    response = veri.exportDataXML(login, sql);
            
                    XmlDocument xmlcari = new XmlDocument();
                    xmlcari.LoadXml(response);
                    XmlNodeList isim = xmlcari.SelectNodes("table/rows/row");
            
                    kkTahsilat = 0;
                    foreach (XmlNode node in isim)
                    {
                        kkTahsilat += XmlConvert.ToDouble(node.ChildNodes\[5\].InnerText);
                    }
            
                }
            

            //Service Reference
            namespace Livella_Cek.webservis {

            \[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")\]
            \[System.ServiceModel.ServiceContractAttribute(Namespace="urn:WebticariService", ConfigurationName="webservis.WebticariServicePortType")\]
            public interface WebticariServicePortType {
            

            [System.ServiceModel.OperationContractAttribute(Action="urn:WebticariService#exportDataXML", ReplyAction="*")]
            [System.ServiceModel.XmlSerializerFormatAttribute(Style=System.ServiceModel.OperationFormatStyle.Rpc, SupportFaults=true, Use=System.ServiceModel.OperationFormatUse.Encoded)]
            [return: System.ServiceModel.MessageParameterAttribute(Name="return")]
            string exportDataXML(string token, string query);
            }
            public string exportDataXML(string token, string query) {
            return base.Cha

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            Whenever I get a SQL error like this, I try to run it directly against the server. You really should try this because the exception you are seeing is telling you that your query is wrong. That's what you're going to have to fix - the problem has nothing to do with C#, or the fact you are running over a web service.

            This space for rent

            J 1 Reply Last reply
            0
            • P Pete OHanlon

              Whenever I get a SQL error like this, I try to run it directly against the server. You really should try this because the exception you are seeing is telling you that your query is wrong. That's what you're going to have to fix - the problem has nothing to do with C#, or the fact you are running over a web service.

              This space for rent

              J Offline
              J Offline
              jschell
              wrote on last edited by
              #6

              Additional suggestion to that. Figure out how and where the replacements are done in the SQL and the log the SQL with those replacements. Then use that for your test. If you do not do that then you are guessing about what the SQL actually looks like. Which might work, and also might not.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups