Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Storing HTTP posted file in General field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01025663
Message ID:
01026136
Vues:
15
Why use a General field? I would use a Blob (in VFP 9) or a binary memo in anything before. General fields don't really provide any useful behavior that you can't duplicate with a few lines of code (other than reporting maybe).

+++ Rick ---

>Hi All,
>
>I want to store files posted on .aspx web page to a field of GENERAL type in VFP table.
>
>I have no problem reading the posted file to an array of bytes, then creating an OleDbAdapter, creating and populating new DataRow, adding it to a DataTable object and so on:
>
>Dim f As HttpPostedFile = ...
>Dim arr(f.ContentLength) As Byte
>Dim s As System.IO.Stream = f.InputStream
>s.Read(arr, 0, filelen)
>...
>r("binarydata") = arr
>tbl.Rows.Add(r)
>...
>DBAdapter.Update(dbset, "AnyName")
>
>Here it comes:
>Exception Details: System.Data.OleDb.OleDbException: Field BINARYDATA does not accept null values.
>

>
>What is wrong with my code? I don't really want to go through creating a temporary file and then reading it to a general field.
>
>System.Text.Encoding.UTF8 didn't help either...
>
>Thanks!
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform