hello I want to save and retrieval a picture from access database and i have this code that i use it in my work but when i use it they tell me that the table that i look for does not exist and i used visual basic .net 2010 .please help me

 Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
        If Trim(txtFileName.Text) = "" Then Exit Sub
        Dim br As New IO.BinaryReader(New IO.FileStream(txtFileName.Text, IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.Read))
        Dim arr() As Byte = br.ReadBytes(br.BaseStream.Length)
        Dim dt As DataTable = ds.Tables(0)
        Dim row As DataRow = dt.NewRow
        row.Item(0) = arr
        row.Item(1) = TextBox1.Text
        dt.Rows.Add(row)
        ds.Tables.Clear()
        ds.Tables.Add(dt)
        da.Update(ds)
        MsgBox("Image added successfully!!", MsgBoxStyle.Information)
    End Sub

Before updatation how could you clear the table name from the data source. Your problem is in line no 10. Don't clear tables name before updatation. If you clear before, how could data-adapter perform update?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.