2010-02-02 91 views
1

对我来说,下面这个简单的string.format()不起作用!string.format conundrum

return string.format(Resources.ABCSTRING, fieldName, fieldType); 

其中Resouces.ABCSTRING是

{1} _{0}; 
    internal {1} {0} 
    { 
     get { return _{0}; } 
     set 
     { 
      _{0} = value; 
      UpdateRowValue(myObj, "{0}", value); 
     } 

    } 
    internal void SetNull{0}() 
    { 
     UpdateRowValue(myObj, "{0}", DBNull.Value); 
    } 

这显然是一些基本的东西,但我没有看到它!任何帮助?

回答

9

你忘了逃避独立的括号。

您需要将其更改为

{1} _{0}; 
internal {1} {0} 
{{ 
    get {{ return _{0}; }} 
    set 
    {{ 
     _{0} = value; 
     UpdateRowValue(myObj, "{0}", value); 
    }} 

}} 
internal void SetNull{0}() 
{{ 
    UpdateRowValue(myObj, "{0}", DBNull.Value); 
}}