The following illustrations show the proper methods of connecting the dishwasher drain.
320.jpg

Please note that the configuration in figure 3 is not allowed in Minnesota.  Although it is allowed in many other states.