我的datagrid帮定了数据库中公司名称一列,由于这一列太长,在显示的时候占据的空间太大,所以我问一下,能不能限制显示的字数,怎么设置,或是在sql语句中怎么控制,谢谢

解决方案 »

  1.   

    自己把列名截取一下吧 用substring或者split等
      

  2.   

    sql语句中 select len(字段名,长度) from 表名
      

  3.   

    提示错误,说len函数只能有一个参数
      

  4.   

    select substring(lie,1,4) from
      

  5.   

    select left(CompanyName,15) from dbo.Customersselect left(字段名,长度) from 表名
      

  6.   

    select case when len(名称)>20 then left(名称,20)+'...' else 名称 end as 名称 from table1
      

  7.   

    select left(字段名,长度) from 表名这个语句在数据库中可以执行,但是在.net的后台中写入的语句就会有错误,我不是调用的过程,而是在后台写的语句