Thursday, August 28, 2008

Store user information on J2ME platform

Problem:

J2ME doesn’t support property files

Solution:

In J2SE properties file can be used to store information but that’s not available on J2ME platform, instead it provides a record store. A sample is available at Sun website.

Sample Link: http://developers.sun.com/mobility/midp/samples/#persist

Problem:

Export excel file from SQL Server 2005. In order to do SQL gave the attached error.

Solution:

Quote: (MSDN)

“By default, SQL Server does not allow ad hoc distributed queries using OPENROWSET and OPENDATASOURCE. When this option is set to 1, SQL Server allows ad hoc access. When this option is not set or is set to 0, SQL Server does not allow ad hoc access.”

MSDN Link: http://msdn.microsoft.com/en-us/library/ms187569.aspx

In order to turn this option on follow the link below

http://www.kodyaz.com/articles/enable-Ad-Hoc-Distributed-Queries.aspx

Tuesday, August 26, 2008

HTTP Post multipart file upload with J2ME

Task:

Upload images from a blackberry device to a website

Solution:

There are a lot of tutorials available to upload form data to a website but we spent sometime looking to post a file to a web server using Multi part. Found the article at Nokia which does the job exactly what we need to do. It’s a very to the point code sample with also a usage sample. Also attaching the code as a zip file incase the link is broken and because the site didn’t have a code download option. All credit goes to Nokia.

Link: http://wiki.forum.nokia.com/index.php/HTTP_Post_multipart_file_upload_with_J2ME

Friday, August 22, 2008

Wednesday, August 20, 2008

ShowDialog Memory leak in WinForm

Recently we had to use a common form to display all the reports for a windows application. For some reason all the reports would work only once. We were using a ReportForm.ShowDialog() to show the report form. Apparently ShowDialog doesn’t dispose the form when its closed as a normal form does when its shown using Form.Visible = True. After a lot of search I came across the article which mentioned that there is a memory leak issue if you don’t dispose the form properly after ShowDialog.

Best Practice according to the article is open the form using the following code and it works, solved our issue.

Quote:

using( SomeDialog sd = new SomeDialog() )
{
sd.ShowDialog();
}

Link:

http://kevin-berridge.blogspot.com/2007_08_01_archive.html

SharePoint Object Browser

Code project article for Sharepoint object browser. It comes very handy when doing programming with sharepoint.

Link:

http://www.codeproject.com/KB/sharepoint/sharepoint_object_browser.aspx

Tuesday, August 12, 2008

Javascript Search Tabs

Nice and short tutorial about using javascript search tabs like google/ yahoo. It has few issues in IE but people have fixed it (check comments).

Link:

http://woork.blogspot.com/2008/01/tabbed-search-bar-using-css-and.html