Friday, December 26, 2008
VB.net SQL statement for SELECT * WHERE mydate = ?
The answer to that was very simple
In Access Database, make sure that the date field is set to Short Date and the Format is "dd/mm/yyyy" or what ever you like.
Then use your normal SQL statement for date and it will work
I have used the following
SELECT * FROM tbl_Student WHERE Enroll_Date = #" & me.cboEnrollDate & "#"
Wednesday, December 24, 2008
How to write Connection String for VB.net and ADO
To tackle this, for Microsoft (R) Access database, we password protect the database. I will not go in details on how to password protect Access database (as this can be another blog in itself), I will show how to open such password protected Access databases through VB.net
Use following connection string to open the normal database
Public ConString As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = " & Application.StartupPath & "\MyDatabase.mdb"
Use following connection string to open a Password protected database
Public ConString As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = " & Application.StartupPath & "\MyDatabase.mdb;Jet OLEDB:Database Password = " & PassWD & " "
Where PassWD is a string constant stored somewhere in the program
I hope this will help someone doing database programming and forgotten how to open a password protected database through VB.net
Thursday, December 18, 2008
Merry Christmas - Monkey wants Banana
Put 7 monkeys (not more not less) in a room. This room has a ladder in the centre and 7 bananas (one for each monkey) on top of the ladder. There are other fruits like mangoes, apples, grapes etc on the ground in abundance. Intelligent Monkeys (oops Humans) are watching what the monkeys are doing from a silver glazed glass window which allows humans to watch monkeys but monkeys can’t see humans.
The rules are:
- To get the bananas, monkey has to climb up the ladder and grab it.
- As soon as one monkey tries to climb up the ladder, other 6 monkeys get sprayed with ice water. The water is so freezing that the 6 monkeys start screaming and running around
- Monkeys can eat any fruit that is lying on the ground but as soon as one tries to get the bananas, others are sprayed with ice water.
After some time monkeys figured out that as soon as some one tries to grab the banana others are sprayed. Instead of thinking of “How to get the bananas”, monkeys make a deal in which who so ever tries to climb up the ladder, others will beat him.
This goes on for some time and, as one monkey tries to climb up the ladder (as the temptation of banana is too big), others fearing that they will be sprayed, they start beating the one trying to climb the ladder.
Now remove 1 monkey from the group of 7 and put a new monkey in.
This new monkey not knowing any rules and deals sees the bananas and tries to get up the ladder, others seeing that the new one is getting up the ladder start beating him (even though they are not sprayed with cold water). The new monkey thinks that it might be a custom to beat someone who tries to go up the ladder.
Now remove another old monkey and put a new one, so there are 2 new and 5 old monkeys.
When the second new monkey tries to go up the ladder, other 6 including the one that was replaced first starts beating the new one. As it is a custom now, slowly and slowly everyone forgets the deal.
Now, slowly and slowly, one by one, remove all the old monkeys and put new monkeys in.
What happens NOW is that whenever any of the monkeys climb up the ladder (because of the temptation) others beat him thinking that it’s a custom of the room not knowing the real deal behind the beating.
In life the story is not different, especially in the corporate world.
Merry Christmas
Thursday, December 11, 2008
Grass is always green on your side
To keep your lawn healthy and green feed them with chook (chicken) manure once a year. Chook manure is really smelly so be prepared to take that strong puff of odor when you are sprinkling it in your lawn. Take a handful and throw it on the ground liberally.
Marketing by Imperessive Reports
The work done to get the data remains same whether I would have given him a report as loose papers or as I did by giving a proper file.
Make usb storage disk recognisable by Windows XP
Headings in Word 2003 and Word 2007
This short-cut will help you to change the text to Heading without going into all the menus or use the Ribbon Bar.
Lengthy Loops in vb.net
In the for loop “i” and “n” are pre defined integers.
For i = 0 to n
…….
…….
Application.DoEvents()
Next
This will make sure that your computer is doing all its normal events during the “for loop” and it will not freeze. Right now when I am writing this, my computer is performing a lengthy for loop that is going on since two hours and my computer is still operational. In the back end the “for loop” is still running.
Monday, December 1, 2008
Difference between Seeing and Observing
Today when I was reading the local news paper, a picture of the same smiley face was shown and it said that the two bright eyes of the smiley face were Venus and Jupiter.
Had I paid more attention to the bright eyes of the smiley face, I would have noticed that the light emitted from those eyes are not twinkling as does with the stars but remains steady as does with the planets. I learned in year 4 in India that stars light twinkles during night time and light from planets remain steady.
Now a days we are bombarded with lots of information every minute. We have information from the newspaper, television, internet (one of the major source of mass information), colleagues, friends and everyone else. Due to this massive bombardment of information, we have started to just see things and not observe it.
There is a huge difference between just seeing things and observing them. We are human beings, highly intelligent of all animal species present on the surface of earth, and have great power to communicate and observe. If we loose one of these qualities, we will soon be going back to the stone ages where people hunt to feed and just lived together to feel secured.
Thursday, November 27, 2008
How to add your business location on Google maps (for free) and show it on your website
There are two ways in which you can add your business on Google Maps. One is to register your business on Google Maps (The hard and lengthy process) or just add your favorite to Google maps and then share it with the world and attach that web location to your website (The easy and faster way shown here)
- Go to www.maps.google.com.au
- Click on My Maps on the Top Left hand corner (A bit lower than top left to be precise)
- Click on the Create new map button
- Sign in with your Google id that you created in step 1
- Click on Create new map button (If you would have already logged into Google maps, you don't need to perform this step)
- Enter the address that you want to show on Google maps in the box adjacent to Search Maps button in Centre Top of the screen
- Once Google maps shows the location, click on the placement marker adjacent to the hand button and place it where you want the world to see your location
- On the left hand side in the Title box enter the name of the place. Like I have "Dharmits Photography" and enter the description if you want to
- In the Privacy and Sharing section, click on Public, so that it can be shared with the world
- Click on Done and it will be saved.
This was just to add a placement marker on Google. Now to place it on your site so that people can click on a photo of the map and it will take them to Google maps at this location.
- Go to Google maps and click on Link on the Top Right hand corner of the Maps section.
- Copy the link that is displayed on the top box and keep it in the location which can be readily accessed later (Keep it in a text file)
- Take a snap shot of the location you added earlier in *.jpg format
- Open another explorer/firefox window and go to your website in editing mode and insert this snap shot of the map
- While keeping this snap highlighted, Click on add link button. A window will pop up asking for the web address
- Now copy the web address that is saved in the text file in this box.
- Save the page and test it. It should work fine
Go to http://sites.google.com/site/dharmitsphotography and on the Homepage, is the photo of the location where I am. Click on the map which will take you to the Google maps page which is interactive.
This is helpful for the customers who want to come to your business location for getting their photos taken.
Wednesday, November 26, 2008
Make your own website with Google Sites
How to start ONLINE MARKETING for your business and Get a Gmail account
This step is a bit time consuming. Think of the usability of your website, think of the customers that will come to your website and what will they think.
What do you want to display on your website.
For inspiration go to http://sites.google.com/site/dharmitsphotography
Steps:
- Go to http://sites.google.com
- Enter your user name and password. Use the username that you created in previous step (YOURNAME.photography@gmail.com or photography.YOURNAME@gmail.com)
- Click on create new site
- It is a straight forward website creation wizard from here and Google has done a pretty good job to make it easy
- Try to break the website into following pages
- Homepage (This is default page, I think)
- Photographs
- Calendar
- Contact Us
- Sitemap (This is default page, I think)
- I have got a Tutorials page on my website but this is optional
Photographs is the page where you will put links to other pages which shows different types of Photographs that you can take and that you have taken. It is more like a preview of what you can do for your customers.
Calendar is the page where you can show your public calendar to your clients who can see when you are busy, when can they expect you to do their work and what work you are doing. (I will write a new post on how to make your Google Calendar publicly viewable very shortly).
Contact US page can be as simple as writing your address, your phone number and your email address so that clients can contact you or you can make a form where client can put their details and what work they want from you and on what date as I have done on my website http://sites.google.com/site/dharmitsphotography/contact-us.
Google makes a Sitemap page by default.
You can put as many pages as you like (Google has limited maximum 100MB on its website, check before you create your own website)
Monday, November 24, 2008
Get a gmail account
This is by far the easiest step out of all.
- Go to www.gmail.com
- Click on Sign up for Gmail
- Fill in the details like your first name, last name etc
- When applying for an email address, try one of these YOURNAME.photography@gmail.com or photography.YOURNAME@gmail.com
- The reason for getting such a long name is that there will be less chances that anyone else will have the same email address
- And you have an email address for your business for FREE
Some words of wisdom for this email address:
- Make sure that you use this email address for all communications with your clients
- Refrain from using this email address for personal use (like sending forwards to friends and communicating with friends)
- Check this email address regularly (atleast thrice a day, Morning, Noon and Evening) so that if you client has replied or sent you an email, you are prompt in replying
- If you are in a discussion with your client currently for photo shoots and purchasing, disregard previous advise and check you email every now and then.
Sunday, November 23, 2008
How to Start ONLINE MARKETING for your business
I faced the same problem when I thought of Marketing for my business. Online marketing is one of the several areas that you need to think about when you are thinking about your business. Getting a domain name, getting a business email address, making a website etc were the questions that I was thinking when online marketing was on my mind.
I started online marketing recently and the only thing that I paid for is my time. Virtually all other things are for free. I know that someone might argue that time is money but my counter argument is that it is your time and that you are not paying someone else to do the work for you yet you are getting results. I thought that I should share my experience of getting my business online for FREE with you.
My website is at http://sites.google.com/site/dharmitsphotography
I have following gear
Camera:
Canon EOS 450D
Canon Powershot S5IS
Lenses (or Glass as pros say):
18-55 IS (kit lense)
55-250 IS (kit lense)
50mm f1.4 (nifty fifty)
I am planning to get wide angle 10-22 EFS
Accessories:
A tripod
Lowepro slingshot camera bag
Pelican SD card case
Please leave a comment or two to let me know if this helped someone
This post is divided into five parts which are described as follows
- Get a gmail account (for business purpose)
- Make your own website with Google sites (for free)
- How to add your business location on Google maps (for free) and show it on your website
- How to make your Google calendar public and show it on your website
- How to make a Customer information form on Google documents and show it on your website
I will be posting here about how I got my photography business online
Wednesday, October 22, 2008
Just do three things in a day
Then I started practicing a simple thing that helped me complete my work, not made me feel too much tired and gave me satisfaction of completing my work. The method is explained as follows:
- At the beginning of the day make a list of tasks that you need to complete (You can do this listing on a previous night before going to bed). Rate them by their priority and give them ranking from 1 to 3. These are main tasks that you need to finish. The remaining tasks will also be numbered from 4 to 6 but will have less priority.
- Any other tasks that has not been ranked can be done tomorrow. Don't spend your entire morning trying to make a list. Use a quick list and start working on it. As you get grips with this routine you will be more efficient in picking your tasks.
- Start your day with the first task and complete it. Keep on taking up a new task only after you have completed the one before.
- If another task pops up from no-where, make an assessment, whether you need to finish the one that popped up or you can continue on the routine that you had previously set.
- Make a list of all the new tasks that might pop up while doing your routine task so that you don't forget them.
- At the end of the day if you have only finished four tasks out of five, carry over the last task to next day and make it your first priority for the next day
Notes:
- There are some tasks that are fit for week ends and so write them down on a separate page
- Use a pocket diary to write your tasks down. This will ensure that you don't loose your record of tasks
- Evaluate this strategy periodically so that you don't fall in a trap of just writing your tasks and not doing them
Wednesday, September 3, 2008
Make combo box non-editable in vb.net
I liked programming in vb6 and then I had to move to vb.net as it was way forward. The experience with vb.net is great but there were some things that I wanted to see in vb.net that were in vb6.
I used to make the combo boxes in vb6 non editable, so the user can only select the list values and not add any of his/her own values. When I tried to do this in vb.net I didn’t know how to do it. I had many programming errors in many of my applications just because of this.
It is more frustrating for a person when he has moved away from something and then realises that it was worth a lot.
Most answers are just underneath your nose. The trick to success is to find it sooner.
Then I realised after searching on the internet that if you make the DropdownStyle property to “DropDownList” it will allow user to select the list values but will not allow user to write their own.
Tuesday, September 2, 2008
Pin Applications to Start Menu

I had always struggled to get the software icons in the location where I could find them easily. I started using Quick launch for this purpose. This was fine for few icons, but then the list started growing and half of my Task bar was filled with software icons. I kept my favourite software application shortcuts on the desktop itself, but my desktop was cluttered so much that I couldn’t see the background image on my desktop. Then I started using a folder on desktop that had all of my favourite software shortcuts. This was alright but I had to click on that folder first to access my icons.
I came across this tip of keeping software icons in start menu and I liked it (I am not sure exactly where I saw this tip so sorry for that), so much so that I started using it straight away. Open the software from the START menu for the first time. When you do this the shortcut is displayed in the START menu. This is fine but when you haven’t used this for a while it disappears from there. To keep it permanently there, right click the application icon and select “Pin to Start menu” as shown in the figure
Monday, September 1, 2008
What to backup when you are formatting your computer
I have an ASUS A6J laptop which I bought in April 2006. This is my first laptop that I have ever bought and I did great research for getting it. When every I decide to format my laptop I back up my entire hard disk to my 160GB WD portable hard disk. I made sure that I had all the utilities and softwares that I will need to install again when I have finished formatting. I backed up all of our photographs as on previous occasion I had formatted my laptop and forgot to backup the photographs from last week. Those photographs were of us inspecting our house that was getting built and was in slab stage. Those photographs were memory for life time but due to one stupid mistake, I wiped them out of our lives. After this instance my wife gave me the 160GB WD portable hard disk as a gift so that I never did this stupid thing again.
After I was satisfied that I have backed up everything, I formatted my laptop and when it was over, I started to install softwares. Everything went perfect and I was happy about my accomplishment. In the evening when my wife took the laptop to check her emails and websites, she looked at me with a question mark on her face. Then in a very sweet voice she asked me “Honey, when you format the laptop and reinstall Windows, do the bookmarks in the explorer get copied automatically?” I knew that was not a question for me to answer and was just to say that “Stupid, you wiped out all of my bookmarks”. After this, I have made a list of things that you need to backup and keep in a safe place before you start formatting your hard disk. The list is
- All important files (and not important files too, you will thank me later)
- Windows settings, remember them or write them down
- Check if you have driver CD (If not get them first before formatting)
- All relevant softwares and utilities
- Photographs
- Work documents
- Bookmarks from Internet explorer or Firefox
- Emails
- Email addresses
- Remember all your passwords or write them down somewhere
- Songs collection
- Movies collection
- Tutorial files (I generally download them as PDF for reading them later)