ciao a tutti
il problema è il seguente, dopo aver fatto una select sul db, e aver letto un campo di tipo varchar, provo a fare la trim ma mi da errore:
codice:
Cast from type 'Field' to type 'String' is not valid
allora ho provato ad utilizzare la funzione in oggetto:
codice:
Trim(DirectCast(Rs("Value"), String))
il risultato è il seguente
codice:
System.InvalidCastException: Specified cast is not valid
non capisco il motivo...sotto trovate il codice completo
codice:
    Dim Rs As Object ' che tipo è veramente???
    dim Conn as Object = CreateObject("ADODB.Connection")
    Conn.Open( connection string)

    Rs = Conn.Execute("select Value from Table where id = 1")
    If Not Rs.Eof Then
      Session("Index_Server") = Trim(DirectCast(Rs("Value"), String))
    end if
grazie 100000000000