Results 1 to 2 of 2

Thread: Writing images to DB??

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    Seattle, WA USA
    Posts
    216

    Writing images to DB??

    I'm having a problem writing my JPEG image to my SQL Server 2000 database. Here's my code. I get the following error: "Unable To Bind To Field or Data member 'Cover'" What am I doing wrong?



    Open .FileName For Binary As #1
    ReDim bytData(FileLen(.FileName))
    End With


    Get #1, , bytData
    Close #1

    With RS
    .AddNew
    .Fields("Cover").AppendChunk bytData
    .Update
    End With
    VB6, VB.NET, C#, SQL, XML, ADO.NET, ASP.NET, HTML.
    MCP & A+ Certified. Looking for a job in the Seattle, WA area.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    Seattle, WA USA
    Posts
    216
    Actually, I just found out that the above error is actually occuring here after an addition to the database:

    If Not (RS.BOF And RS.EOF) Then
    txtTrack.Text = RS.Fields("track")
    txtArtist.Text = RS.Fields("artist")
    Set Image1.DataSource = RS 'setting image1's datasource
    Image1.DataField = "Cover" 'set its datafield.
    End If
    VB6, VB.NET, C#, SQL, XML, ADO.NET, ASP.NET, HTML.
    MCP & A+ Certified. Looking for a job in the Seattle, WA area.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width