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
上传中...
上传图片
插入图片