Halloj. Är filen sparad i UTF-8? Om inte så måste du ange vilken encoding som används när du öppnar filen.ÅÄÖ med StreamReader och SQL-Server 2005
    
    
Jag har en liten snurra som läser in en textfil och ska spara dess data i en tabell på en SQL-server 2005. Detta funkar lysande förutom att den skiter i åäö, någon som vet vad det kan bero på???
Här är koden:
            'OPEN FILE, READ IN AND PRINT A LABEL
            Dim oLineRaw As New IO.StreamReader("C:\PEngineDump\" & sender)
            Dim str As String
            Dim CustomerNumber, Consignor, ConsignorAddress, ConsignorAddress2, ConsignorZip, 
ConsignorCity, ConsignorPhone, Consignee, ConsigneeAddress, ConsigneeAddress2, ConsigneeZip, 
ConsigneeCity, ConsigneeCountry, ConsigneePhone, Reference, PreferredPrinter, PrinterType, 
PrinterModel As String
            Dim Collis As Integer
            Dim Weight As Double
            Dim strSplit As Array
            Dim nValid As Integer
            Dim nSegments As Integer
            str = oLineRaw.ReadLine
            strSplit = Microsoft.VisualBasic.Split(str, ";")
            nSegments = UBound(strSplit)
            If nSegments = 19 Then
                CustomerNumber = strSplit(0)
                Consignor = strSplit(1)
                ConsignorAddress = strSplit(2)
                ConsignorAddress2 = strSplit(3)
                ConsignorZip = strSplit(4)
                ConsignorCity = strSplit(5)
                ConsignorPhone = strSplit(6)
                Consignee = strSplit(7)
                ConsigneeAddress = strSplit(8)
                ConsigneeAddress2 = strSplit(9)
                ConsigneeZip = strSplit(10)
                ConsigneeCity = strSplit(11)
                ConsigneeCountry = strSplit(12)
                ConsigneePhone = strSplit(13)
                Reference = strSplit(14)
                Collis = strSplit(15)
                Weight = strSplit(16)
                PreferredPrinter = strSplit(17)
                PrinterType = strSplit(18)
                PrinterModel = strSplit(19)
else
                MessageBox.Show("För få segment i infilen","Läsningsfel")
end if
    Sv: ÅÄÖ med StreamReader och SQL-Server 2005