OleDbDataAdapter DBCommand =new OleDbDataAdapter (); 
DBCommand= new OleDbDataAdapter("Select FriendlyName as [Name], "
+"StoreAddress as [Address], " 
+ "StoreDirections as [Directions] " 
+ "From StoreLocations Where " 
+ "ZipCode = '"
+ ddlZipCode.SelectedItem.Text 
+ "' Order By FriendlyName " 
, DBConn);这个里面为什么 有 as [Address]  []????

解决方案 »

  1.   

    "select Friendlyname as [name],StoreAddress as [Address], StoreDirections as [Directions] from StoreLocations where ZipCode='"+ddlZipCode.SelectedItem.Text+"' order by FriendlyName"
      

  2.   

    我写成OleDbDataAdapter DBCommand =new OleDbDataAdapter ("select EmployeeFirstName"+" "+"EmployeeLastName" +"as FullName,"+"EmailAddress from EmployeeBrithdays where DatePart(mm,BrithDate)=DataPart(mm,GetDate()) and DatePart(dd,BrithDate)=DatePart(dd,GetDate()) Order By EmployeeLastName",DBConn);
    还报同样的错误???
      

  3.   

    改成:
    OleDbDataAdapter DBCommand =new OleDbDataAdapter ("select EmployeeFirstName"+","+"EmployeeLastName " +"as FullName,"+"EmailAddress from EmployeeBrithdays where DatePart(mm,BrithDate)=DataPart(mm,GetDate()) and DatePart(dd,BrithDate)=DatePart(dd,GetDate()) Order By EmployeeLastName",DBConn);
    注意sql语句中的空格和“,”