Tuesday, August 30, 2011

Confidence

Today:
30th aug, Feeling different and confident and strong.
Last night went to TO, was fasting. Had a orange Juice, Food from lahor Tikka, Tandor, beef, and chicken.

Friday, August 26, 2011

Working with Database In ASP.net


1. Here is my starting point. MSDN

2. Linaccess database

3. Import Some data to view

4. Update/ Delete some data

5. Run complex Queries

6. Processing data

Wednesday, August 24, 2011

Database Configuration: MySql with Visual studio 2010

Problem no 1:
There are no mysql option as visul studio 2010 and mysql conflicts each other. This is know issue.
Solution: VS 2010 and connector conflict. Solution Found here

Problem 2:
Database is not allowed to connect.
Possible Solution: Granting Explicit Solution to the indivual user.

Finally found the solution of Database connection problem. It was because of the
On Windows, root accounts are created that permit connections from the local host only. Connections can be made by specifying the host name localhost, the IP address 127.0.0.1, or the IPv6 address ::1. If the user selects the Enable root access from remote machines option during installation, the Windows installer creates another root account that permits connections from any host.

http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html

Tuesday, August 23, 2011

Server Error in '/Test' Application.

This error is blocking us from continuing testing.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'connectionStrings'

Source Error:

Line 7:   Line 8:   Line 9:     Line 10:     

Solution Are
3. Sever Deployment is not correct: See here

Finally, found the solution how to fix this.

1. Installed .NET framework 4

2. Copied “System.Web.Mvc”to the bin directory (this is not needed if ASP.NET MVC is installed on the server). To include this with your project, in Visual Studio, under references, make sure that “Copy Local” is set to true for “System.Web.Mvc”

3. In IIS Manager

a. Enabled the ASP.NET v4 web service extension

b. For the “mvc” application, set the ASP.NET version to 4 under the “ASP.NET” tab

c. Enabled wildcard mapping

i. In the directory tab, clicked configuration

ii. Clicked “Insert” and added “c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll” and made sure that “Verify that file exists” is NOT checked

d. Created a new app pool for the mvc application (.NET 4 applications need to run in a separate app pool from .NET 1, 2, 3, or 3.5 applications) and change the “mvc” application to use this new app pool (change it in the directory tab)

e. Restarted the web site







Thursday, August 18, 2011

Enabling Services in IIS ( ASP.NET)

Enabling the services (ASP.net) gave me quite a bit hard time since i was not aware of it. It was showing 404 error when i was accessing webpage

Saturday, August 13, 2011

How to make a bitmap as button ...

But the ButtonField or BitmapField click is not happening in Blackberry 4.7 simulator.

I want to build it for Blackberry Storm so I m using Blackberry 4.7

How to handle click/touch events for ButtonField & BitmapField for Blackberry Storm?

http://stackoverflow.com/questions/1351101/how-to-handle-buttonfield-bitmapfield-click-touch-events-in-blackberry-storm

Blackberry Manual

Blackberry Zen Manual
http://docs.blackberry.com/en/smartphone_users/deliverables/138/GSG_8830_BlackBerry_Zen.pdf

Blackberry Tutorials Site

Thinking Blackberry




Blackberry Progress Bar

http://stackoverflow.com/questions/2652824/starting-one-blackberry-screen-from-another

Sorting in Blackberry

Sorting vector or arrays is difficult in J2ME because J2ME APIs doesn’t include the collections framwork.
But Blackberry API has sortable collections like SimpleSortingVector or you can use Arrays class sort method also.
The key in sorting is Comparator interface that allows you to specify how the elements should
be compared. Sorting using Comparator is a good example of strategy pattern and the Java idiom for function-pointer-like functionality.

1. Create your Data class.

1. Create your Data class.

  1. class Data {
  2. private String name;
  3. private int age;
  4. public Data(String name, int age) {
  5. this.name = name;
  6. this.age = age;
  7. }
  8. String getName() {
  9. return name;
  10. }
  11. int getAge() {
  12. return age;
  13. }
  14. }
2. Key of sorting method is Comparator that allows you to specify how the elements should
be compared.
Here we will create two implementaion of Coparator one for name and another for age.

  1. class NameComparator implements Comparator {
  2. public int compare(Object o1, Object o2) {
  3. return ((Data) o1).getName().compareTo(((Data) o2).getName());
  4. }
  5. }
  6. class AgeComparator implements Comparator {
  7. public int compare(Object o1, Object o2) {
  8. return ((Data) o1).getAge() - (((Data) o2).getAge());
  9. }
  10. }
3. First we will see the use of SimpleSortingVector.


  • SimpleSortingVector sortingVector = new SimpleSortingVector();
  • sortingVector.addElement(new Data("b", 25));
  • sortingVector.addElement(new Data("a", 31));
  • sortingVector.addElement(new Data("c", 26));
  • sortingVector.setSortComparator(new AgeComparator());
  • sortingVector.setSort(true);
  • Enumeration en = sortingVector.elements();
  • StringBuffer sb = new StringBuffer();
  • while (en.hasMoreElements()) {
  • Data data = (Data) en.nextElement();
  • sb.append(data.getName() + " " + data.getAge() + "\n");
  • }
  • System.out.println(sb);
  • 4. Now we will see the Arrays class sort method.

  • Data[] data = {new Data(“b”,32),new Data(“a”,23),new Data(“c”,34)};
  • Arrays.sort(data, new NameComparator());

  • http://blog.vimviv.com/blackberry/sorting-blackberry/#more-398