2010-12-02 12 views

Odpowiedz

10

Spróbuj DateTime.ParseExact()

przykład z MSDN z danymi:

Dim dateString, format As String 
Dim result As Date 
Dim provider As Globalization.CultureInfo = Globalization.CultureInfo.InvariantCulture 

' Parse date and time with custom specifier. 
dateString = "20090910" 
format = "yyyyMMdd"   
Try 
    result = Date.ParseExact(dateString, format, provider) 
    Console.WriteLine("{0} converts to {1}.", dateString, result.ToString()) 
    Console.ReadLine() 
Catch e As FormatException 
    Console.WriteLine("{0} is not in the correct format.", dateString) 
End Try 
+0

ok hold on pozwolił mi spróbować taht próbowałem coś podobnego wcześniej, że nie działał ... – Matthew

+0

nie wydaje się podoba . ssis daje naprawdę niejasne błędy i nie mogę przejść przez kod w komponencie skryptowym – Matthew

+0

, który mówi: Konwersja z ciągu znaków "2" "do typu" Double "jest niepoprawna – Matthew