我用一個轉換程序將這個VB到C#轉換一個VB.NET共享功能,以C#
Public Overloads Shared Function ExecuteReader(ByVal statement As String, ByVal commandType As CommandType, _
ByVal paramCollection As ArrayList, ByVal connectionDelegate As OpenDatabaseConnection, _
ByVal outputConnectionObject As IDbConnection, ByVal CommandTimeout As Int16) As InstantASP.Common.Data.IDataReader
Return PrivateExecuteReader(Configuration.AppSettings.DataProvider, _
statement, commandType, paramCollection, connectionDelegate, outputConnectionObject, CommandTimeout)
End Function
我不熟悉VB.NET轉換,我不知道爲什麼這個轉換器將其轉換爲C#與所有這些裁判。我甚至不會使用ref,如果有的話,不要認爲這是最好的/最乾淨的方式來轉換這一點。但是,我無法理解包括轉換在內的所有這些情況,並且在轉換後如果這樣做有任何意義。
public static IDataReader ExecuteReader(string statement, CommandType commandType, ArrayList paramCollection, OpenDatabaseConnection connectionDelegate, IDbConnection outputConnectionObject, Int16 commandTimeout)
{
return PrivateExecuteReader(ref AppSettings.DataProvider(), ref statement,
ref commandType, ref paramCollection, ref connectionDelegate,
ref outputConnectionObject, ref commandTimeout);
}
參數列表對於'PrivateExecuteReader(...)'是什麼樣的? – aligray 2011-06-14 03:02:26
還不確定。我正在轉換一個我將要購買的軟件代碼包,但還沒有運行。 – PositiveGuy 2011-06-14 03:15:02