csDataFormat csDF=new csDataFormat("InventoryID");
string s=csDF.FormatString;

解决方案 »

  1.   

    类csDataFormat有个参数("InventoryID")有个属性.FormatString
    我要在不声明新对象的情况下对她操作。
    csDataFormat csDF=new csDataFormat("InventoryID");
    string s=csDF.FormatString;
    就是不要你写的第一行,
    直接
    string s = csDataFormat("InventoryID").FormatString
    谢谢了。
      

  2.   

    把FormatString声明成静态的就可以了
      

  3.   

    是不是  public static string FormatString
      

  4.   

    string s = csDataFormat("InventoryID").FieldName
    出错误了。
      

  5.   

    呵呵,回答了,类方法,和java一样
      

  6.   

    Class a
    {
    public static string FormatString    static a()
        {
           FormatString="dfa";       
        }}
    string s = csDataFormat.FormatString
    你要用静态构造函数,就不能带参数。