Click here to Skip to main content
15,893,337 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
I am trying this code:
C#
private void GetImage(string fullName)
{            
  SQLiteConnection sqlite_con = 
    new SQLiteConnection("Data Source=|DataDirectory|dbasedict.s3db;" + 
    "Version=3;New=False;Compress=True;");
  String querry2 = "select 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)            
  {
    int id = Convert.ToInt32(row["iimages"]);
    byte[ data = (byte[)row["dictionario"];
    ms = new MemoryStream(data);
  }
  pictureBox1.Image = Image.FromStream(ms);            
}


I get a syntax error because fromstream is not supported in PPC 5.

I then found in a thread that I can use the Bitmap method as an alternative of fromstream in PPC and I found this code:

C#
public static Image GetImage(string fullName)
{
  Assembly thisExe = System.Reflection.Assembly.GetExecutingAssembly();
  System.IO.Stream file = thisExe.GetManifestResourceStream(fullName);
  //Image image = Image.FromStream(file); // This won't work with the CF
  // But this works in both environments!
  Bitmap image = new Bitmap(file);
  file.Close();
  return image;
}


Now, my problem is I don't know how to debug it because I am just a newbie in developing in .NET CF.

Can anyone help with the debugging please...

Thanks....
Posted
Updated 6-Feb-10 4:04am
v2

You debug as you would any other application. If you are using the installed emulator Visual Studio will start it and deploy your package. If you are using a device connected to your development machine you need to set the options to use it rather than the emulator
 
Share this answer
 
if i need to access mydb.sqlite to access, is this connection string works?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900