Results 1 to 38 of 38

Thread: [RESOLVED] Received error when I click button

Threaded View

  1. #1

    Thread Starter
    Banned
    Join Date
    May 2008
    Posts
    461

    Resolved [RESOLVED] Received error when I click button

    I need your help, I am trying to get over this problem and I don't know why I get an error message everytime when I click the button.



    Here it the code:

    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
    Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * From Table1", "Put an actual connection string here.  THIS SHOULD NOT BE COPIED MINDLESSLY AND EXPECTED TO WORK")
            Dim dt As New DataTable
            da.Fill(dt)
    
            Dim img As Image
    
            For Each row As DataRow In dt.Rows
                img = Image.FromStream(New IO.MemoryStream(DirectCast(row.Item("NameOfImageColumn").Value, Byte())))
                'Do something with the image
            Next
    End Sub


    Error: Format of the initialization string does not conform to specification starting at index 0.



    It shows highlight on Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * From Table1", "Put an actual connection string here. THIS SHOULD NOT BE COPIED MINDLESSLY AND EXPECTED TO WORK") as statement. What can I do to get this fix??



    Thanks,
    Mark
    Last edited by Mark107; Jun 28th, 2008 at 10:52 AM.

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