2010-02-02 72 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); 
}}