[HowTo] Application start on “Wake up” event
Using this code will allow you to configure your application to start or to display following a system wakeup event. /// <summary> /// This function starts running an application when a specified event occurs. /// </summary> /// <param name=”application”>The application. eg: @”\Program Files\testapp\testapp.exe”</param> /// <param name=”notificationEvent”>Event at which the application is to be started. Use […]
Invoke Required when updating UI via another thread.
As you know, creating a Thread in the UI using System.Threading object (or any other thread object that is not UI related) does not allow that thread to access directly the UI objects (Eg: accessing a label “Text” property is not allowed). The well know work around is to “Invoke the action in the UI” […]
[HowTo] Establish a GPRS connection with TcpClient
NETCF’s HttpWebRequest automatically sets up a GPRS connection for web requests/web services when a wired/wi-fi connection is not available. Therefore, when you do a web request or consume a web service, developers do not need special coding to handle the GPRS connection case. This does not apply to lower level socket classes like TcpClient and […]
[HowTo] Save Image into SqlCE database
Save into database. //Image to byte[] Image myImage = Image.FromFile(“c:\\xyz.jpg”); System.IO.MemoryStream imgMemoryStream = new System.IO.MemoryStream(); myImage.Save(imgMemoryStream, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] imgByteData = imgMemoryStream.GetBuffer(); //Store image bytes data into database SqlCeConnection scon = new SqlCeConnection(“Data Source=D:\\myDB.sdf”); SqlCeCommand cmd = new SqlCeCommand(“Update ImageTable Set Picture=@myPicture Where Username=’Martin'”, scon); cmd.Parameters.Add(“@myPicture”, SqlDbType.Image).Value = imgByteData; // Or cmd.Parameters.Add(“@myPicture”, SqlDbType.Binary).Value = imgByteData scon.Open(); […]
C# To VBasic convertor
Useful tool for converting Visual Basic To C# or C# to Visual Basic : http://www.developerfusion.com/tools/convert/vb-to-csharp/