2 loveryourloser loveryourloser 于 2014.03.07 17:35 提问

为什么这样的SQL语句报错?都来看看

private void BindCustomer()
{
string customerId = Session["customerId"].ToString();
//CustomerCompany
string sql = "select CustomerId CustomerId,CustomerCompany CustomerCompany,CustomerName CustomerName,LoginName LoginName,Password Password,Mobile Mobile,Phone Phone,QQ QQ,Mail Mail,Address Address,MessageBalance MessageBalance from Customer a,CustomerBalance b where a.CustomerId=b.BelongTo and a.BelongTo=" + customerId;
DataTable dtCustomer = DBHelper.GetDataSet(sql);
gvCustomer.DataSource = dtCustomer;
gvCustomer.DataKeyNames = new string[] { "CustomerId" };
gvCustomer.DataBind();

    }

各位注意啊我是想表达为什么CustomerId CustomerId,CustomerCompany CustomerCompany,CustomerName CustomerName,LoginName LoginName,Password Password,Mobile Mobile,Phone Phone,QQ QQ,Mail Mail,Address Address,MessageBalance MessageBalance这两个一摸一样的字段为什么不报错?

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!