in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

exception is unhandled

Last post 02-07-2010 8:03 AM by amw403. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 02-07-2010 8:03 AM

    exception is unhandled

      private void GetImage()
            {            
                SQLiteConnection sqlite_con = new SQLiteConnection("Data Source=|DataDirectory|dbasedict.s3db;Version=3;New=False;Compress=True;");
                String querry2 = "select id, word, iimages from dictionario where word = '" + searchBox.Text + "'";
                SQLiteDataAdapter adap3 = new SQLiteDataAdapter(querry2, sqlite_con);
                DataSet set = new DataSet();
                adap3.Fill(set, "dictionario");
                DataTable dataTable = new DataTable();
                dataTable = (DataTable)set.Tables[0];
                MemoryStream ms = null;
                foreach (DataRow row in dataTable.Rows)            
                {                
                    byte[ ] data = (byte[ ])row["iimages"];
                    ms = new MemoryStream(data);
                    Bitmap bmp = new Bitmap(ms);
                    pictureBox1.Image = bmp;                                                    
                }            
            }

     

    When i try this code, i ended up having an error saying: Exception is unhandled

    Anyone who can help me debug this code?

    I cannot use image.fromstream because i run this code in a windows mobile pocketpc 5 sdk.

Page 1 of 1 (1 items)
Powered by Community Server (Commercial Edition), by Telligent Systems