hello,
this is my last chance.. it's still not working.
I will try to explain it simple:
I have a database
I have a textfile (vcf)
my App shows the info that is in the database.
I want to import the textfile show there will be a new contact show in my app saved in the database.
this is the info in the textfile:
BEGIN:VCard
VERSION:2.1
N:De Jong
FN:Anne
TEL;WORK;VOICE:0512540540
TEL;WORK;VOICE:0512540540
TEL;HOME;VOICE:06-11299731
TEL;CELL;VOICE:06-11299731
TEL;VOICE:0512 540221
TEL;WORK;FAX:0512 540540
TEL;FAX:0512 540221
ADR;WORK;PREF:;;Sjoerd Veltmanstraat 15;Drachten;;9203 NJ
ENCODING=QUOTED-PRINTABLE:Sjoerd Veltmanstraat 15
URL;HOME:www.epixfotostudio.nl
URL;WORK:www.epixfotostudio.nl
EMAIL;PREF;INTERNET:odejong@epixfotostudio.nl
END:VCARD
From N till Fax is inserted into the database.
From the Adres will not be inserted. This is my code to insert:
Do While objReader.Peek >= 1
strRegel = objReader.ReadLine(1)
strWaarde = strRegel.Split(":")
strWaarde = strRegel.Split(";")
Dim blnDubbel As Boolean
Select Case UCase(strWaarde(0))
Case "BEGIN", "VERSION", "END", _
"ENCODING=QUOTED-PRINTABLE"
Case "N"
strNaam = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbTab)
Case "FN"
strVoornaam = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "TEL;WORK;VOICE"
If blnDubbel = False Then
strTelWerk = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbTab)
blnDubbel = True
End If
Case "TEL;HOME;VOICE"
strTelThuis = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "TEL;CELL;VOICE"
strMobiel = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbTab)
Case "TEL;VOICE"
strOverig = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "TEL;WORK;FAX"
strFaxWerk = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbTab)
Case "TEL;FAX"
strFaxThuis = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "ADR;WORK;PREF:"
strAdgegevens = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "URL;HOME:"
strUrlThuis = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbTab)
Case "URL;WORK:"
strUrlWerk = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "EMAIL;PREF;INTERNET:"
strMail = strWaarde(1)
sbBuilder.Append(strWaarde(1))
Case Else
sbBuilder.Append(strWaarde(1) & vbCrLf)
End Select
Loop
objReader.Close()
frmVCard.txtVCard.Text = sbBuilder.ToString
Dim strInsert As String
strInsert = "INSERT INTO Relaties (B22_relnr, B22_rel_soort, B22_naam, B22_voornaam_etc, " _
& "B22_adres, B22_postcode, B22_plaats, B22_telefoon1, B22_telefoon2, " _
& "B22_mobielnr, B22_faxnummer, B22_email, B22_www_adres, B22_zoeknaam) " _
& " VALUES (" & intNummer & ", '" & strSoort & "', '" & strNaam _
& "', '" & strVoornaam & "', '" & strAdres _
& "', '" & strPostcode & "', '" & strPlaats & "', '" & strTelWerk _
& "', '" & strTelThuis & "', '" & strMobiel & "', '" & strFaxWerk _
& "', '" & strMail & "', '" & strUrlWerk & "', '" & strZoek & "' )"
Dim ds_B22 As New OdbcCommand
ds_B22.CommandType = Data.CommandType.Text
ds_B22.CommandText = strInsert
ds_B22.Connection = cnn
ds_B22.ExecuteNonQuery()
If MsgBox _
("De V-Card is geïmporteerd", 0, "V-Card is geïmporteerd") Then
Exit Sub
End If
I hope someone can help me out.
I have download a vcf file from this forum but I still dont get it.
just give me an example to show how to get the info into the database.
Thanks