if I read your code correctly, tempData will contain a ByteArray and not a String. Without having tried the code or having VW at hand right now, I guess that is your problem. Will file contain ASCII Data or binary Data?
>
>
>Hi
>
>I am new in smalltalk, and am loving its complier and debugging facilities but
>because of its differences with other " typical"
>languages im running into problems for which I would easily find solutions
>over the web. May be anyone of you would be able to help
>me. May be I am just missing out some steps.
>
>So here is the problem:
>I am trying to insert a file in my SQL server 2005 DB and I get an error when
>I get to the part where the filedata is being read
>into the SQL insert statement
>[CODE]
>
>1>tempINT:='123'.
>2>upload := (request anyFormValueAt: 'fileBeingUploaded') value.
>3>fileName := (request anyFormValueAt: 'fileName') value.
>4>tempName:=fileName.
>
>5>tempData:= upload value asByteArray. "getting fileData"
>
>6>connection := Database.MS_SQLServerConnection new.
>7> connection
> username: 'usrnm';
> password: 'paswd'.
>8> connection environment:
> 'Driver={SQL Native
>Client};Server=SYED;Database=MYDB;Uid=usrnm;Pwd=paswd;'.
>9> connection connect.
>10> session := connection getSession.
>11> session
> prepare:
> 'INSERT INTO TBFile(SYSID,FILENAME,FILEDATA) VALUES(',
>tempINT,',',tempName,',',tempData,')'.
>12> session execute.
>13> ansStrm := session answer.
>14> ansStrm := session answer.
>[/CODE]
> On line 11> I get error when my debugger comes to tempData and just says "
>Strings should contain characters" : is it because its
>expecting a string because prepare takes a String.
>My aim is to store a file in the DB for our application and this is supposed
>to be a very simple task in other languages but I am
>stuck ( conceptually and programatically) on how to solve this issue.
>
>I would really appreciate if any one can help on this. Thanks in advance.
>Thanks.
>Regards,
>Syed Mahdi
>Software Engineer
>
>
>
>_______________________________________________
>vwnc mailing list
>
[hidden email]
>
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc