XML MySql error
-
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 -
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 -
Can you tell why the error was caused by considering the error picture?
-
Can you tell why the error was caused by considering the error picture?
-
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.ChaWhenever 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
-
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
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.