tryOleDbDataAdapter 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);

解决方案 »

  1.   

    我改为("select EmployeeFirstName + ',' 后报'DataPart' 不是可以识别的 函数名
      

  2.   

    "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"
    中间不用加双引号
      

  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);
     我已经写的很简洁了,但是还是报'DataPart' 不是可以识别的 函数名。
      

  4.   

    我改了过来!
    但是它又报System.Data.OleDb.OleDbException: 对象名 'EmployeeBrithdays' 无效。 数据库里有EmployeeBrithdays 。为什么?
      

  5.   

    EmployeeBrithdays拼错了吧,是不是EmployeeBirthdays
      

  6.   

    我试成功了!!!
    对了,我设置DATAGRID中的<asp:ButtonColumn DataTextField="EmailAddress" HeaderText="Email地址:"></asp:ButtonColumn>
    我不想<asp:ButtonColumn >  </asp:ButtonColumn > 中的字段显示下华线,我应该怎么办。 
    从<asp:ButtonColumn DataTextField="EmailAddress" HeaderText="Email地址:"></asp:ButtonColumn> 我本来就没有让它显示下华线,但是它还是显示了下划线》??????
      

  7.   

    <asp:ButtonColumn DataTextField="EmailAddress" ButtonType="PushButton" HeaderText="Email地址:"></asp:ButtonColumn>