Multipart indetifier c.Customer_CNIC无法绑定。请帮我,ThanX [英] Multipart indetifier c.Customer_CNIC could not be bound.help me with this, ThanX

查看:85
本文介绍了Multipart indetifier c.Customer_CNIC无法绑定。请帮我,ThanX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Select CASE i.Installment_no 
            WHEN 1 THEN i.Loan_id, c.Customer_CNIC 
                   ELSE '' END AS LOAN_ID, 
            i.Installment_no, i.Date, i.Amount 
  from Installments i,
       Loan l,
       Customer c 
 where l.Loan_id = c.Loan_id 
   and c.Loan_id = i.Loan_id 
   and c.Customer_CNIC = '" + cbocnic1.Text + "-" + cbocnic2.Text + "-" + cbocnic3.Text + "' 
 order by l.Loan_id,i.Installment_no"

推荐答案

这是SQL,而不是C#。请正确标记你的问题



我看到你在C#中构建这个SQL,并且你的SQL是在表示层中构建的,其方式可以让任何人擦除或攻击您的数据库。阅读SQL注入攻击。



你应该抓住你的SQL字符串并在管理工作室中运行它来调试它。但是,错误意味着它不能告诉c是什么,或者列不存在。



This is SQL, not C#. Please tag your questions properly

I see you''re building this SQL in C#, and that your SQL is built in the presentation layer, in a way that lets anyone erase or attack your DB. Read up on SQL injection attacks.

You should grab your SQL string and run it in management studio to debug it. However, the error means that it can''t tell what c is, or that the column does not exist.

WHEN 1 THEN i.Loan_id, c.Customer_CNIC ELSE '' END AS LOAN_ID,







这不起作用。这可能是错误。摆脱它,你有1,这意味着你希望它总是运行。我想你想要






This does not work. It''s probably the error. Get rid of it, you have when 1, which means you expect it to always run. I think you want

WHEN 1 THEN i.Loan_id ELSE '' END AS LOAN_ID, c.Customer_CNIC


这篇关于Multipart indetifier c.Customer_CNIC无法绑定。请帮我,ThanX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆