School assignment

hey, i need help with my assignment. in this assignment i need to be able to use ArrayLists, and im having trouble with that. the plan is to load student information into a data base and save it in the arraylist. i think is done by using a temporary folder. heres what i have so far:
public static Student loadStudent (ArrayList student) {
            String lastName, firstName, street1, city1, state1, street2,
            city2, state2, homePhone, cellPhone;
            int id,zip1, zip2;
            double GradePointAve;
            System.out.println("\nEnter Last Name:");
            lastName = MyInput.readString();
            System.out.println("\nEnter First Name:");
            firstName = MyInput.readString();
            System.out.println("\nEnter Home 1:");
            System.out.println("\nEnter Street :");
            street1 = MyInput.readString();
            System.out.println("\nEnter City:");
            city1 = MyInput.readString();
            System.out.println ("\nEnter State:");
            state1 = MyInput.readString();
            System.out.println("\nEnter Zip:");
            zip1 = MyInput.readInt();
            System.out.println("\nHome 2:");
            System.out.println("Enter Street:");
            street2 = MyInput.readString();
            System.out.println("\nEnter City:");
            city2 = MyInput.readString();
            System.out.println ("\nEnter State:");
            state2 = MyInput.readString();
            System.out.println("\nEnter Zip:");
            zip2 = MyInput.readInt();
            System.out.println("\nEnter Home Phone:");
            homePhone = MyInput.readString();
            System.out.println("\nEnter Cell Phone:");
            cellPhone = MyInput.readString();
            System.out.println("\nEnter GPA:");
            GradePointAve = MyInput.readDouble();
            System.out.println("\n");the user enters all that information, how should i take this information and save it in the array list. please help, thanks.

ok, i want to do somthing different now, i want to give each student an ID #. Also, i have a deleteStudent method that can delete a student. I want to give a student an ID. Thats the easy part, but, if a student gets deleted, i want there ID to never to be gone forever. For example: joe:ID 5, Greg:Id 6. Delete Greg, now no Id #6, and wen new students get loaded in, they do not go to number six, but go to the end of the list. i was thinkin about using
student.add()would this be the right direction, any help would be appreciated, thanx

Similar Messages

  • Need Help with my School Assignment - Error Message

    Hey guys,
    I'm doing a school assignment for my Object Oriented Java programing class. Here's the assignment requirements:
    "There are five kinds of flowers, and their associated costs. Create an array of strings that holds the names of these flowers. Create another array that holds the cost of each corresponding flower. Your program should read the name of a flower and the quantity desired by a customer. Locate the flower in the name array and use that index to find the cost per stem in the cost array. Compute and print the total cost of the sale. Write your solution in one class: FlowerCounterArray.
    The solution should implement the following two methods:
    - addOrder(String flowerName, int quantity) to add to the order. This is in addition to reading from the terminal.
    - printTotal() to print out the total cost to the terminal."
    I wrote up some code so far and I want to test it, but I am getting this error: "']' expected" on the newFlower[0] = new FlowerCounterArrays("petunia", 0.50]; line near the end of the code.
    Here's my code:
    public class FlowerCounterArrays {
        private String flowerName;
        private double price;
        public void addOrder(String flowerName, int quantity) {
            for (FlowerCounterArrays flower : newFlower) {
                if (flower.equals(flowerName)) {
                    total = price * quantity;
                    System.out.println("The price for " + quantity + " " + flower + "(s) is " + total);
                else {
                    System.out.println("Unfortunately we do not carry that type of flower here.");
        public void printTotal() {
            System.out.println(total);
        FlowerCounterArrays[] newFlower = new FlowerCounterArrays[5];
        newFlower[0] = new FlowerCounterArrays("petunia", 0.50];
        newFlower[1] = new FlowerCounterArrays("pansy", 0.75);
        newFlower[2] = new FlowerCounterArrays("rose", 1.50);
        newFlower[3] = new FlowerCounterArrays("violet", 0.50);
        newFlower[4] = new FlowerCounterArrays("carnation", 0.80);
    }Thanks for the help guys! Much appreciated!
    Edited by: he4dhuntr on Oct 14, 2008 1:33 PM

    Ok. I'm kind of new to all this, so some stuff I'm not 100% clear on.
    I get what you're saying though. I put the array into the method.
    Although now I get a new errod: "cannot find symbol - constructor FlowerCounterArrays(java.lang.String,double)"
    I get this error on my newFlower[0] = new FlowerCounterArrays("petunia", 0.50); line
    Here's my new code:
    public class FlowerCounterArrays {
        private String flowerName;
        private double price;
        public void addOrder(String flowerName, int quantity) {
            FlowerCounterArrays[] newFlower = new FlowerCounterArrays[5];
            newFlower[0] = new FlowerCounterArrays("petunia", 0.50);
            newFlower[1] = new FlowerCounterArrays("pansy", 0.75);
            newFlower[2] = new FlowerCounterArrays("rose", 1.50);
            newFlower[3] = new FlowerCounterArrays("violet", 0.50);
            newFlower[4] = new FlowerCounterArrays("carnation", 0.80);
            for (FlowerCounterArrays flower : newFlower) {
                if (flower.equals(flowerName)) {
                    total = price * quantity;
                    System.out.println("The price for " + quantity + " " + flower + "(s) is " + total);
                else {
                    System.out.println("Unfortunately we do not carry that type of flower here.");
        public void printTotal() {
            System.out.println(total);
    }Thanks for the help so far!

  • Sunday afternoon: School assignment due tomorrow

    Hi all,
    I am hoping someone can offer some suggestions.
    We are a Mac household, but purchased MS Office as the adults in the house work a lot with businesses who have not converted (yet). My daughter's enlightened school has installed Macs (yay!).
    However, in typical teenager style she has an assignment due tomorrow and has just informed me that she sent the assignment home and now can't open it.
    Her document is in Pages, and of course, we don't actually have iWorks here at home .... grrrr
    I have tried opening the Pages document in MS Word, but of course it is not recognised at all. I tried opening with Text Edit but still no success: it says the file is corrupt?
    Could it be that the file is really corrupt or do I need to purchase iWorks ? I am hoping there is some workaround at the moment, just to get us through the Sunday afternoon, assignment due tomorrow blues.
    Thanks for any assistance!

    Hi Suzanne,
    You can download a free thirty-day trial of iWork (no s) '09. There's a link to the download on the iWork product page here.
    Regards,
    Barry

  • No apps available in self service menu from school. Need to download an app for homework. Help?

    no apps available in self service menu from school. need to download app for homework. Help

    Sounds like your school is using the MDM Casper by JAMF. The JAMF Software Server (JSS) may not be available outside your schools network. You will likely have to wait until you are at school to download the apps from Self Service.
    If your school is using VPP Managed Distribution, check the App Store "Purchased" tab to see if your school assigned any apps to you there. Be sure that you are logged in to the Apple ID that you used when enrolling.
    Hope this helps!
    ~Joe

  • Need help for school! Imported images suddenly pixelated (CS6, Windows)

    Hi guys,
    Adobe InDesign CS6 Windows I'm a frequent user of InDesign, but I now suddenly am facing problems. Note: I use InDesign not only for print material, but also for creating PDF. I therefore do not necessarily need 300 dpi. Before: copy + paste from Photoshop or even web images into InDesign used to work. The images looked fine on screen and while printing. Now, when I import or copy + paste, all images look pixelated at 100%, high quality and overprint preview. It looks like InDesign is importing images 25% larger than their original size. If I resize the imported image to 75%, the image looks normal. 100% is always pixelated now! Did I mess up some sort op setting? I never had this problem before. Please help me, need this for school assignment!
    Thanks in advance,
    Justin

    First of all, thank you for your reply. I just checked an example image and both are 72 dpi, in InDesign as well as in Photoshop. I even created a document for web in InDesign, using the 'web' & digital publishing option (which is 72 dpi) and placed the same image. At 100% pixelated, when resizing to 75% crisp. I don't know what to do..
    The thing is.. I've never had this problem for years.. with importing images. Did I change settings or?
    First one is Photoshop, second in InDesign (top left is import at 100%, bottom right is import resized to 75%). In case images are too small to see, full size: http://justinwust.com/photoshop.jpg & http://justinwust.com/indesign.jpg

  • How can the iPad connect to a school network?

    Just completing a school assignment and was wondering how the iPad connects to a school network?

    If you are looking for the basics of wi-fi connectivity, you can check out this  article
    http://computer.howstuffworks.com/wireless-network.htm

  • HELP! Uploading AS3 Game to server, no sound and Spacebar doesn´t work HELP!

    Hello, relatively new to AS3 and flash, this is the first time i am publishing anything. We are trying to upload our simple flashgame to our webserver, the game works perfectly fine locally save for one thing. We get an error regarding TLF which says it wont stream or something. So when it gets online, no sounds play and spacebar doesn't work, left and right arrow does work. We have three TLF text fields that are used to update score, lives and show you final score. If i turn these into classical text they stop working.
    Things we have tried: Changing default linkage from RLS to Merged into code, changing the text boxes to classical text(they then stop working), made sure the paths are correct(all files are in the same directory including the .swz file)
    This is the code from the soundclass:
    package 
        import flash.net.URLRequest;
        import flash.media.Sound;
        import flash.media.SoundChannel;
        import flash.events.*;
        public class MySound
            private var bgSound:Sound;
            private var fireSound:Sound;
            private var waterSound:Sound;
            private var earthSound:Sound;
            private var lightSound:Sound;
            private var soundChannel:SoundChannel;
            public function MySound()
                soundChannel = new SoundChannel();
                bgSound = new Sound();
                var req:URLRequest = new URLRequest("BackgroundSound.mp3");
                bgSound.load(req);
                //fire
                fireSound = new Sound();
                var req2:URLRequest = new URLRequest("soundFire.mp3");
                fireSound.load(req2);
                // water
                waterSound = new Sound();
                var req3:URLRequest = new URLRequest("soundWater.mp3");
                waterSound.load(req3);
                // earth
                earthSound = new Sound();
                var req4:URLRequest = new URLRequest("soundEarth.mp3");
                earthSound.load(req4);
                // light
                lightSound = new Sound();
                var req5:URLRequest = new URLRequest("soundLight.mp3");
                lightSound.load(req5);
            public function playBgSound()
                soundChannel = bgSound.play(0, 999999);
            public function stopBgSound()
                soundChannel.stop();
            public function playFireSound()
                fireSound.play();
            public function playWaterSound()
                waterSound.play();
            public function playEarthSound()
                earthSound.play();
            public function playLightSound()
                lightSound.play();
    I can somewhat get that sound can bugg out, but why does spacebar stop functioning? ANy help is greatly appreciated as this has to be delivered in twelve hours(published online) for a school assignment.

    Also might add publishing it locally in my own browser everything works, as does ofcourse playing it in flash itself. Changing from RLS to merged into code stops the error from coming, but doesn´t fix the problem on the server.
    Code from main class related to sound and spacebar:
    import flash.display.*;
        import flash.events.*;
        import flash.ui.Keyboard;
        import flash.text.TextField;
        import flash.media.Sound;
        import flash.net.URLRequest;
        import flash.events.MouseEvent;
        import flash.utils.Timer;
        import flash.events.TimerEvent;
        public class main extends MovieClip
            private var fireTimer:Timer; //delay between shots
            private var canFire:Boolean = true;
            private var mySound:MySound;
            private var bulletSpeed:Number = -450;
              public function main()
                //load sounds
                mySound = new MySound();
            private function playGame(event:MouseEvent)
                gotoAndStop(2);
                // initialize
                myLives = 5;
                myHitsNo = 0;
                weaponType = 1;
                mybullets = new Array();
                enemys = new Array();       
                myScoreTxt.text = "Score: " + myHitsNo;
                myLivesTxt.text = "Lives: " + myLives;   
                fireTimer = new Timer(400, 1);
                fireTimer.addEventListener(TimerEvent.TIMER, shootTimerHandler, false, 0, true);
                stage.addEventListener(KeyboardEvent.KEY_DOWN, listenKeyDown);
                stage.addEventListener(Event.ENTER_FRAME, addEnemy);
                stage.addEventListener(Event.ENTER_FRAME, checkCollision);   
                player = new thePlayer(stage.stageWidth-40, spawnPoint2);// stage.stageHeight/2);
                stage.focus = player;
                addChild(player);
                mySound.playBgSound();
    public function listenKeyDown(event:KeyboardEvent)  // Controls and weapontype selector
                if (event.keyCode == 37) //left
                    player.movethePlayerDown();
                if (event.keyCode == 39) //right
                    player.movethePlayerUp();
    if (event.keyCode == Keyboard.SPACE) //space
                    shootBullet();
                    //soundFX.attachSound("Pistol Fire.wav");
                    //soundFX.start();

  • How do I convert an alpha character from a text string to its decimal value

    I am trying to find out the actual decimal value of a character in a string. So far the code below is as far as I got. I am able to get what I guess is a byte value.
    This is for a school assignment:
    The idea behind what I am trying to do is to design a hash function to store dictionary words into a bucket array hash table, without using the existing Hashtable.class
    so far this is what I can come up with to get some kind of value for each character in the string, however, what I am trying to get is the decimal value for each character.
    public static void main(String args[]){
         String word = "abcdefghijklmnopqrstuvwxyz";
         for (int i=0 ; i < word.length(); i++){
         System.out.print((word.substring(i,i+1)));
         System.out.print("\t : "+((word.substring(i,i+1))).getBytes());
    Thankyou for any replies.

    I'm not sure I completly understand your goal- what you mean by "decimal value", but, if you simply want to find the byte value of each character in a String, you would probably be better off using getBytes() in a way like this,
    byte [] bytes = string.getBytes();
    Then, if you need to map that to a charcter, you could use a for loop like
    for (int x = 0; x < bytes.length; x++) {
    table.put((char)bytes[x], bytes[x]);
    which assummes this bucket class of yours allows primitive data types like so (in Hashtable or HashMap, you would have to use a wrapper Object). I guess, my point reduces to, don't use substring and string search methods (like indexOf()), unless you have to because they are more expensive then just maping the array of bytes and chars, which seems to be what you are interested in doing.

  • I NEED HELP!!!!

    I have been having problems for more than a week now. It all started just after I updated to IE8, Firefox 3.6.6 and Adobe Flash Player 10.1. It started with just games crashing everytime I loaded one on Facebook. I would get a message saying the flash player crashed and to refresh the page. Then it started crashing my entire system everytime I loaded a game. A couple of days ago my system crashed and didn't recover. I had to do a complete system restore. I'm not trying to imlpy that's any fault of Adobe's, however, it is a bit strange that I had no problems until these updates. I've had this pc for almost 5 years. After the system restore and losing everything, I reloaded the browsers, and the flashplayer. And in case you're going to say anything about having 2 different browers, I have to. My school uses IE and I hate it! So for everything else I use Firefox...including Facebook games. Anyway, the problem is, my system is still crashing everytime I try to load a game. The entire system is still crashing! I've read through the forums and tried various so called fixes including uninstalling and reinstalling (and yes...I used the Adobe uninstaller), unchecking or checking hardware accelerator in settings. I'm tried of "trying" things. I need this fixed before my computer is permanatly damaged beyond repair!!!! Occassionally I have to use your flash player to view videos for school assignments! I can't risk being in the middle of a school assignment or Lord help me...a quiz and having my system crash again!! I am not opposed to going back to version 9 (I had no problems at all with it), which I did try to find but could only find one for programmers!!!
    This is a copy/paste of all the information I believe you requested:
    Operating System
    OS Name         Microsoft Windows XP Home Edition
    OS Version         5.1.2600
    ServicePack         3.0
    Product ID         76477-OEM-0011903-00103
    System Uptime         7/6/2010 7:54:30 PM
    Internet Explorer Version         8.0.6001.18702
    Microsoft DirectX Version         9.0c (4.09.00.0904)
    OpenGL Version         5.1.2600.5512 (xpsp.080413-0845)
    Processor MainBoard Center Processor     CPU Name         Intel(R) Celeron(R) CPU 2.93GHz
    If I've missed including any information needed, let me know what it is (and where to find it please)
    I'll be checking this post every couple hours
    Thank you.....

    Based on my experience reading on the Adobe Flash forum and  the Mozilla Firefox forum, there isn't a "universal solution" to a crash  problem.  That is, what works for one person might not work for another -- even  though both are doing the IDENTICAL same thing.  I don't know why that is, but  it is true.
    For example, I have ALWAYS had Flash 9 and Firefox 2 (the  highest versions of each that I can have for my Windows 98 operating system)  crash on YouTube, whereas on other  web sites the Flash videos would play  great.  So, I read on the Firefox forum that one man had success on YouTube with  a particular archived Flash 9 version and Firefox 2.  So, I installed THAT Flash  version with Firefox 2, but it still crashed on YouTube.  To watch YouTube with  Firefox 2, I eventually had to install Flash 8, and that works  fine.
    You said Flash 9 crashed on opening Farmville on Facebook.   Did you try other sites with Flash content?  Maybe it has something to do with  the interaction with Flash 9 and Farmville, in the same way I had a bad  interaction with Flash 9 and YouTube.
    I can understand that you don't have time "to keep trying this  and that", as you say, but I think you will have to do a little experimentation,  since everybody's system is a little different.  If you are systematic about it,  it shouldn't be too bad. 
    First, you might want to download a couple more "Netscape"  type browsers (these use the Flash PLUGIN like Firefox does) and try them with  Flash 10.  (I have Netscape 7.0 and Opera 10.10 in addition to Firefox 2, but  your newer operating system would probably allow you to get the latest versions  to try first -- these are good browsers, in my opinion.)  The neat thing about  installing a Flash plugin is that it installs on EVERY "Netscape" type browser  that you have at the SAME time, so you don't have to install it 3 times if you  have 3 different "Netscape" type browsers. It is kind of like the Adobe Flash  uninstaller removing EVERY Flash Player installed on your system.
    If  Flash 10 doesn't work with the latest versions of Netscape  and Opera, try Flash 9 with these browsers. (If I understand you correctly, you  have already established that Flash 9 and 10 don't work with your latest  versions of IE and Firefox).  If you don't have any luck, then I would just  concentrate on trying older and older versions of IE and Firefox with the latest  Flash 9 that you downloaded.
    If nothing works, just for the heck of it, you might try Flash  8 to see if ANYTHING will work.  You can download the archived Flash 8 versions  at http://kb2.adobe.com/cps/142/tn_14266.html
    In folder r42, which has the latest archived versions, run  flashplayer8r42_win.exe for your "Netscape" type browsers, such as Firefox, and  flashplayer8r42_winax.exe for your IE browser.  This is the _win.exe I'm using  to successfully watch YouTube videos with Firefox 2.
    IN THE INTEREST OF SAVING YOU TIME AND ENERGY, YOU MIGHT  DISPENSE WITH DOWNLOADING THE NETSCAPE AND OPERA BROWSERS, AND JUST CONCENTRATE  ON OLDER AND OLDER VERSIONS OF IE AND FIREFOX WITH FLASH 9.
    Sorry for all these words.  I hope you can put together  something useful from all this verbiage.
    GOOD LUCK ON YOUR FINAL.
    larryb123456   

  • I need help urgently!!!  How do you get a button to open up a menu or something that has more buttons on it.

    I need to find out how to create a button that when pressed will bring up a menu with other buttons on it. I am doing this for a school assignment. Basicly, i select "Shoes" and that brings up a menu where i can chose from a bunch of different shoes. Please help!!

    create a submenu movieclip that contains the additional buttons.
    you can then add a listener to your main button the causes that movieclip to be added to the stage (eg, by using addChild).

  • CS3 Premiere error 0xc0000409 on boot-up no matter how many times I install

    It wasn't easy finding this forum place but anyway I hope you can help me out
    first off I use Windows XP and it is CS3 Premiere Pro I am talking about of the Master Suite, second off I am not English and because my error was displayed in Dutch I have tried to make a translation that was as accurate as I could.
    Well how it started, Premiere was working fine one morning, I have been using it for about a year no errors nothing with any of my products however when I came back from school one day and decided to rip some audio for a school assignment it started crashing on boot up without giving me any indication to why it was doing this, the purple block came up and when it was done windows popped up with the message that the application had to be terminated and that was it..
    So I tried to reinstall and afterwards my After Effects joined in on the fun with the Virtual Function Call and library errors, Premiere had no changes in it at all. So I tried again and then After Effects complained about not being able to unpack the effects and this went on for 5 hours afterwards with every reinstall I would either have the virtual memory plus or the unable to unpack fileformats and effects error..
    I scanned my pc for viruses, zero were found, I tried system restore but that failed because there weren't any changes made to the system and so I called a repair man who took my computer away and took a look at it himself, he installed the master suite again and now After Effects works again however Premiere says this when it starts up
    an exception unknown exception in software (0xc0000409) has occurred in the application on location 0x06ad5389
    the beginning part made me laugh a little and I just tried to use a different setup and tried to trial version however that one as well results with the same error message as labelled above and I fear that every time I install it this will happen..
    So could anyone care tell me wth is going on?

    okay I'll work off the list:
    1. the proble: listed above int he opening post
    2. hardware:
    system: Windows XP Home Edition Service pack 3
    Computer:
    Intel(R) Core(TM)2 Duo CPU
    E6750@ 2.66 Ghz
    Ram and work memory: 2.13 Ghz and 2.00 GB
    vid card: NVIDIA GeForce 8500 GT
    current driver version: 6.14.11.6921
    3. project settings, I didn't save the project but it was a Pal and I only imported an audio file and navigated through it nothing else:
    Codec: 0x0161 (WMA v2)
    after that my premiere started crashing with the "this application had to be shut down error" and when reinstalling it wouldn't go away and then After Effects started erroring with the Virtual stuff followed by unable to unpack effects so I checked for virusses, tried System restore but both had no effect because there were no virusses and no changes were made to the system. So I send my pc to repairs and they were reinstalled it and told me there was nothing wrong with my system and so I tried to boot up Premiere again btu I got this error now, After Effects however works fine I must add
    I tried reinstalling on a different drive but it doesn't help..
    4. See what I wrote at step 3
    5. http://www.mediafire.com/download.php?q2miyoowlyb
    for the DXDIAG TXT file
    6. http://www.mediafire.com/download.php?xlq2t33y25u
    for the NFO file from MSINFO32
    7. Process Explorer:
    made 2 screenshots so that the list will fit
    http://www.mediafire.com/download.php?5zdmynjmztm
    http://www.mediafire.com/download.php?5zdmynjmztm
    8. Speedfan:
    http://www.mediafire.com/download.php?nzitoj2uj3u
    I assume this screenshot contains the results
    all the above files can also be found in this folder
    http://www.mediafire.com/?sharekey=41c749ab86c8473ed6baebe61b361f7ce04e75f6e8ebb871
    Decided to upload the screens there too because photobucket resized them to unreadable size and Imageshack took too long

  • How do I get this loop to give me numbers within a range?

    So for a school assignment I need to get a loop to display all the numbers in a certain range. This range is input by the user with a starting number and an end number. For some reason when i put the code in all its giving me is the end number and not the numbers between the start and end. I was wondering if someone could show me what to tweak to fix it. This is the code so far...
    // Add event listener
    submit_btn.addEventListener(MouseEvent.CLICK, onClick);
    function onClick(event:MouseEvent):void {
    // Declare Variables
    var startInput:String;
    var endInput:String;
    var startNum:Number;
    var endNum:Number;
    // Get Start Value from Text Field
    startInput=start_txt.text;
    // Convert value from string to number
    startNum = Number(startInput);
    // Get End Value from Text Field
    endInput=end_txt.text;
    // Convert value from string to number
    endNum = Number(endInput);
    // For loop
    for (var range:int = startNum; range <= endNum; range++ )
        response_txt.text = "The numbers between the inputed integers are " + range + "!";
    I've also include the actual program so you can see it if you want to test it..
    Thanks for your help,
    The Student of Flash

    Being that you're a student and this is an assignment, I have to honor what I believe the intentions of the assignment are, which is for you to solve it and get it working, not for someone else to hand you the solution.  But I can offer a hint...
    It's not a question of slowing it down, it's a question of controlling what gets written to the output textfield when.  If you did the trace you saw that it was rewriting the textfield in each loop.  So just as a hint, look up the appendText() method of the TextField class.

  • How can i make this game to be over in 3 minutes?

    i'm really a total beginner, and this is the race game code for my school assignment.
    How can i possibly make this game to be over in 3 minutes?
    It says "game over" when you hit 20 cars.
    I want to make it say "you've made it!" or something when they survive for 3 minutes with less than 20 crashes.
    please help! T.T
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.Timer;
    public class BugRace extends Applet implements KeyListener, Runnable{
      Image buff;
      Canvas Panel;
      Graphics2D gPanel;
      Graphics2D gBuffer;
      Bug redBug;
      Bug[] rivals=new Bug[20];
      Button StartButton;
      //Button StopButton;
      Thread game;
      Timer time;
      private boolean loop=true;
      Dimension dim=new Dimension(200, 300);
      private int road;
      Random rnd=new Random();
      private int crash = 0;
      public void init(){     
        prepareResource();
        setBackground(Color.gray);
        setSize(400,400);
        initPanel();
        add(Panel);
        // Start Button
        StartButton=new Button("START");
        add(StartButton);
        StartButton.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent ae){
            // request focus for Panel to get key event
            Panel.requestFocus();
            if(!game.isAlive()){
                 game.start();}else if(game.isAlive()){
                 game.start();}
        /*StopButton=new Button("STOP");
        add(StopButton);
        //StopButton.addActionListener(new ActionListener(){
         public void actionPerformed(ActionEvent ae){
            //Panel.requestFocus();
              if(game.isAlive())
                   game.stop();}
      public void prepareResource(){ //load bug images
        Image imgRed=getImage(getCodeBase(),"redbug.gif");
        Image imgBlue=getImage(getCodeBase(),"bluebug.gif");
        Image imgYellow=getImage(getCodeBase(),"yellowbug.gif");
        Image imgPurple=getImage(getCodeBase(),"purplebug.gif");
        MediaTracker mt=new MediaTracker(this);
        try{
          mt.addImage(imgRed, 0);
          mt.addImage(imgBlue, 1);
          mt.addImage(imgYellow, 2);
          mt.addImage(imgPurple, 3);
          mt.waitForAll();
        }catch(Exception e){}
        buff=createImage((int)dim.getWidth(), (int)dim.getHeight());
        gBuffer=(Graphics2D)buff.getGraphics();
        redBug=new Bug(imgRed, 80,250, dim);  // user's bug
        for(int i=0;i<10;i++){
           rivals=new Bug(imgBlue, 0, 0); // rival blue bug
    for(int i=5;i<rivals.length;i++){
    rivals[i]=new Bug(imgYellow, 0, 0); // rival yellow bug
    for(int i=10;i<rivals.length;i++){
    rivals[i]=new Bug(imgPurple, 0, 0); // rival purple bug
    for(int i=0;i<rivals.length;i++){  // set locations for rival bugs
    setrivals(i);
    game=new Thread(this); // game thread for controlling
    public void stop(){
    loop=false; // stop the thread
    public void run(){
    while(loop){
    drawPanel(); // draw game screen
    try{ Thread.sleep(50);}catch(Exception e){}
    public void initPanel(){    // initialize the panel
    Panel=new Canvas(){
    public void paint(Graphics g){
    if(gPanel==null){
         gPanel=(Graphics2D)Panel.getGraphics();
    drawPanel();
    Panel.setSize(dim); // size of the panel
    Panel.addKeyListener(this); //add keylistener for the game
    // set rival bugs' location randomly, and make them not intersect each other
    void setrivals(int en){ 
    int x, y;
    next:while(true){
    x=rnd.nextInt((int)dim.getWidth()-rivals[en].getWidth());
    y=-rnd.nextInt(5000)-200;
    // if (x,y) intersect to each other, go to next
    for(int j=0;j<rivals.length;j++){
    if(j!=en && rivals[j].collision(x, y))continue next;
    // set (x, y) as en rival bug's location and exit from while loop.
    rivals[en].setLocation(x, y);
    break;
    void check(Bug en){       // check if bugs collides
    if(redBug.collision(en)){        // if collide,
    if(redBug.getX()>en.getX()){  // if rival bug is on the left side from user's,            
    en.move(-10, 0); // move rival bug in 10 to the left
    redBug.move(10, 0); // move user's bug in 10 to the right
    crash++;          //add # of crash
    else{                     // if rival bug is on the right side from user's,
    en.move(10,0); // move rival bug in 10 to the right
    redBug.move(-10, 0); // move user's bug in 10 to the left
    crash++;          //add # of crash
    synchronized void drawPanel(){                        // draw panel
    gBuffer.clearRect(0, 0, (int)dim.getWidth(), (int)dim.getHeight()); //clear buffer
    gBuffer.setPaint(new Color(0, 150, 0));          //fill background in green
    gBuffer.fillRect(0, 0, (int)dim.getWidth(), (int)dim.getHeight());
    drawRoad(); // draw the road
    // draw rival bugs moving down
    for(int i=0;i<rivals.length;i++){
    rivals[i].move(0, 15); // move rival bugs down
    rivals[i].draw(gBuffer, Panel); // draw the bugs in panel
    if(rivals[i].getY()>dim.getHeight()){ //if a rival bug is out of panel
         setrivals(i);} // set it at initial position
              check(rivals[i]); // check if they intersect
    redBug.draw(gBuffer, Panel); // draw user's bug
    gPanel.drawImage(buff, 0,0, Panel); // draw buffer in panel
    if(crash<20){
         gPanel.setFont(new Font(null,Font.BOLD,15));
         gPanel.drawString("crash:"+crash,30, 30);}
    else{
         gPanel.setFont(new Font(null,Font.BOLD,15));
         gPanel.drawString("crash:"+crash,30, 30);
         gPanel.setFont(new Font(null,Font.BOLD,20));
         gPanel.drawString("Game Over", 50, 100);
              gPanel.dispose();
    void drawRoad(){ // draw yellow center line
    road+=80;
    gBuffer.setPaint(Color.yellow);
    gBuffer.fillRect((int)dim.getWidth()/2, road,10,150);
    if(road>=dim.getHeight()){ //if the line goes lower than  panel
         road=-150;                    //move it up again
    }else if(crash >20){
         road=0;
    public void keyPressed(KeyEvent ke){       
    if(ke.getKeyCode()==KeyEvent.VK_LEFT){     // if left arrow is pressed,
    redBug.move(-20,0); // the bug moves to the left
    else if(ke.getKeyCode()==KeyEvent.VK_RIGHT){  // if right arrow is pressed
    redBug.move(20,0); // the bug moves to the right
    public void keyReleased(KeyEvent ke){}
    public void keyTyped(KeyEvent ke){}

    import java.util.Timer;
    import java.util.TimerTask;
    public class Test {
        public static void main (String[] args) {
            final Timer timer = new Timer ();
            System.out.println ("I'm gonna do something in 5 seconds.");
            timer.schedule (new TimerTask () {
                public void run () {
                    System.out.println ("Time's up !");
                    timer.cancel ();
            }, 5000);
    }if you want to display the time left it's better to make your own Thread that updates a "timeleft variable:
    {code}
    public class Test {
    //set the time Left to 3 mins.
    private long secondsLeft = 3 * 60;
    public Test () {
    new Thread (new Runnable () {
    public void run () {
    try {
    while (secondsLeft > 0) {
    //Let's update the timer every second.
    Thread.sleep (1000);
    secondsLeft = secondsLeft - 1;
    System.out.println ("Time left: " + (secondsLeft / 60) + ":" + (secondsLeft % 60));
    System.out.println ("Grats !");
    } catch (InterruptedException e) {}
    }).start ();
    public static void main (String[] args) {
    new Test ();
    {code}

  • SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.

    Here is sql Store procedure
    Create procedure InsertResMasterNEW 
            @urm_id int output, 
            @upm_sector varchar(60) , @upm_block varchar(50) , @upm_plot varchar(50) , @urm_entry_dt datetime, 
            @urm_loc_adv varchar(50) ,@urm_alott_catg varchar(50) , @urm_grnd_rent numeric(18,0) , @urm_grnd_rent_pp varchar(50), 
            @urm_grnd_rent_desc varchar(50) ,   @urm_resi varchar(50) , @urm_shop_allowed varchar(50) , @urm_non_resi varchar(50), 
            @urm_yes_resi varchar(50) , @urm_allot_no varchar(50),  @urm_allot_dt datetime ,    @urm_reg_dt datetime, 
            @urm_exe_dt datetime , @urm_coop_name varchar(50) , @urm_coop_reg_no varchar(50) ,  @urm_org_cost numeric(18,0), 
            @urm_bp_cost numeric(18,0) ,    @urm_interest_paid numeric(18,0) ,  @urm_amount_paid numeric(18,0) ,    @urm_bal_due numeric(18,0), 
            @urm_poss_dt datetime , @urm_poss_cert_no varchar(50) ,  @urm_poss_type varchar(50) , @urm_grnd_rentupto_yr numeric(18,0) , 
            @urm_grnd_rent_paid numeric(18,0) , @urm_grnd_rent_bal numeric(18,0) ,  @urm_pln_submitted varchar(50) , @urm_pln_subm_org_dt datetime, 
            @urm_pln_subm_org_no varchar(50) ,  @urm_pln_subm_rem varchar(50) , @urm_pln_sanctioned varchar(50) , @urm_pln_sanc_org_dt datetime, 
            @urm_pln_sanc_no    varchar(50) ,   @urm_pln_sanc_rem varchar(50) , @urm_pln_sanc_rev_dt datetime , @urm_pln_sanc_rev_no varchar(50), 
            @urm_const_status varchar(50) , @urm_const_storeys varchar(50) , @urm_pln_storeys   varchar(50) , @urm_comp_storeys varchar(50) , 
            @urm_const_rem varchar(50) ,  @urm_comm_util varchar(50) , @urm_comm_util_other varchar(50) , @urm_pub_util varchar(50), 
            @urm_pub_util_other varchar(50) ,   @urm_ind_util1 varchar(50) , @urm_plot_lease_ownby varchar(50) , @urm_prev_alloted varchar(50), 
            @urm_whose_fav varchar(50) , @urm_tenyr_exp varchar(50) , @urm_tenyr_org_dt datetime , @urm_tenyr_org_no varchar(50), 
            @urm_tenyr_rev_dt datetime , @urm_tenyr_rev_no varchar(50) , @urm_tenyr_rem varchar(50) , @urm_cc_rem varchar(50) 
    AS 
    Declare @urm_upm_id int 
    Begin 
    select @urm_upm_id=upm_id from URB_PLOT_MASTER  
        where upm_sector=@upm_sector  
        and   upm_block=@upm_block  
        and   upm_plot=@upm_plot  
    Insert into URB_RES_MASTER( urm_upm_id  , 
                                urm_entry_dt , urm_loc_adv , urm_alott_catg , urm_grnd_rent, 
                                urm_grnd_rent_pp,  urm_grnd_rent_desc, urm_resi,   
                                urm_shop_allowed,  urm_non_resi,  urm_yes_resi,  urm_allot_no, 
                                urm_allot_dt, urm_reg_dt,  urm_exe_dt,  urm_coop_name, 
                                urm_coop_reg_no, urm_org_cost, urm_bp_cost, urm_interest_paid,  
                                urm_amount_paid,  urm_bal_due,  urm_poss_dt,  urm_poss_cert_no,   
                                urm_poss_type, urm_grnd_rentupto_yr, urm_grnd_rent_paid,  urm_grnd_rent_bal,  
                                urm_pln_submitted,  urm_pln_subm_org_dt,  urm_pln_subm_org_no,  urm_pln_subm_rem, 
                                urm_pln_sanctioned, urm_pln_sanc_org_dt,  urm_pln_sanc_no, urm_pln_sanc_rem,  
                                urm_pln_sanc_rev_dt, urm_pln_sanc_rev_no,urm_const_status, urm_const_storeys,  
                                urm_pln_storeys,  urm_comp_storeys,  urm_const_rem,  urm_comm_util,   
                                urm_comm_util_other,  urm_pub_util, urm_pub_util_other, urm_ind_util1,   
                                urm_plot_lease_ownby, urm_prev_alloted, urm_whose_fav,  urm_tenyr_exp, 
                                urm_tenyr_org_dt, urm_tenyr_org_no, urm_tenyr_rev_dt, urm_tenyr_rev_no,  
                                urm_tenyr_rem, urm_cc_rem ) 
                        values( @urm_upm_id,   @urm_entry_dt, @urm_loc_adv ,  @urm_alott_catg , 
                                @urm_grnd_rent,  @urm_grnd_rent_pp,  @urm_grnd_rent_desc, @urm_resi,   
                                @urm_shop_allowed, @urm_non_resi,  @urm_yes_resi,  @urm_allot_no,  
                                @urm_allot_dt,  @urm_reg_dt,  @urm_exe_dt, @urm_coop_name,   
                                @urm_coop_reg_no ,  @urm_org_cost,  @urm_bp_cost,   
                                @urm_interest_paid,  @urm_amount_paid,  @urm_bal_due,  @urm_poss_dt, @urm_poss_cert_no,  
                                @urm_poss_type, @urm_grnd_rentupto_yr,   @urm_grnd_rent_paid, @urm_grnd_rent_bal, 
                                @urm_pln_submitted,   @urm_pln_subm_org_dt, @urm_pln_subm_org_no, @urm_pln_subm_rem , 
                                @urm_pln_sanctioned,  @urm_pln_sanc_org_dt, @urm_pln_sanc_no, @urm_pln_sanc_rem , 
                                @urm_pln_sanc_rev_dt, @urm_pln_sanc_rev_no, @urm_const_status, @urm_const_storeys,  
                                @urm_pln_storeys, @urm_comp_storeys, @urm_const_rem, @urm_comm_util,  
                                @urm_comm_util_other, @urm_pub_util, @urm_pub_util_other, @urm_ind_util1,  
                                @urm_plot_lease_ownby, @urm_prev_alloted, @urm_whose_fav, @urm_tenyr_exp,  
                                @urm_tenyr_org_dt, @urm_tenyr_org_no, @urm_tenyr_rev_dt, @urm_tenyr_rev_no,  
                                @urm_tenyr_rem, @urm_cc_rem ) 
    End 
    SELECT @urm_id=SCOPE_IDENTITY() 
    And the c# from i  send the data to the store procedure .. and it throws me the problem ..
    Server Error in '/LandMangement' Application.
    SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
    Description: An
    unhandled exception occurred during the execution of the current web
    request. Please review the stack trace for more information about the
    error and where it originated in the code.
    Exception Details: System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
    Source Error:
    Line 134: strLastError = ex.Message;
    Line 135: else
    Line 136: throw ex;
    Line 137: }
    Line 138:
    Source File: e:\LandMangement\App_Code\DAL\DBAccess.cs    Line: 136
    Stack Trace:
    [SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.]
    SechBhaban.DAL.DBAccess.ExecuteNonQuery(String commandtext) in e:\LandMangement\App_Code\DAL\DBAccess.cs:136
    SechBhaban.BOL.ResiMaster.Insert(String sector, String block, String plot, DateTime urm_entry_dt, String urm_loc_adv, String urm_alott_catg, Int32 urm_grnd_rent, String urm_grnd_rent_pp, String urm_grnd_rent_desc, String urm_resi, String urm_shop_allowed, String urm_yes_resi, String urm_non_resi, String urm_allot_no, DateTime urm_allot_dt, String urm_prev_alloted, String urm_whose_fav, DateTime urm_reg_dt, DateTime urm_exe_dt, String urm_coop_name, String urm_coop_reg_no, Int32 urm_org_cost, Int32 urm_interest_paid, Int32 urm_bp_cost, Int32 urm_amount_paid, Int32 urm_bal_due, DateTime urm_poss_dt, String urm_poss_cert_no, String urm_poss_type, Int32 urm_grnd_rentupto_yr, Int32 urm_grnd_rent_paid, Int32 urm_grnd_rent_bal, String urm_pln_submitted, DateTime urm_pln_subm_org_dt, String urm_pln_subm_org_no, String urm_pln_subm_rem, String urm_pln_sanctioned, DateTime urm_pln_sanc_org_dt, String urm_pln_sanc_no, DateTime urm_pln_sanc_rev_dt, String urm_pln_sanc_rev_no, String urm_pln_sanc_rem, String urm_tenyr_exp, DateTime urm_tenyr_org_dt, String urm_tenyr_org_no, DateTime urm_tenyr_rev_dt, String urm_tenyr_rev_no, String urm_tenyr_rem, String urm_pln_storeys, String urm_const_status, String urm_comp_storeys, String urm_const_storeys, String urm_const_rem, String urm_cc_rem, String urm_comm_util, String urm_comm_util_other, String urm_pub_util, String urm_pub_util_other, String urm_ind_util1, String urm_plot_lease_ownby) in e:\LandMangement\App_Code\BOL\ResiMaster.cs:128
    Residential.SaveResidentialbttn_Click(Object sender, EventArgs e) in e:\LandMangement\Residential.aspx.cs:104
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
    protected void SaveResidentialbttn_Click(object sender, EventArgs e) 
            int retVal = 0; 
            //Insert 
            if (SaveResidentialbttn.Text == "Save") 
                String AllotDate = Request.Form["txtAllotDate"]; 
                retVal = ResiMaster.Insert(ddlSector.SelectedValue, txtBlock.Text, txtPlot.Text, DateTime.Parse(txtEntryDate.Text), 
                                             txtLocation.Text, txtCatagory.Text, Int32.Parse(txtGroundRent.Text), txtPerPeriod.Text, 
                                             txtGroundRentDesc.Text, ddlResi.SelectedValue, ddlShopAllowed.SelectedValue, ddlIfResdenditial.SelectedValue, 
                                             ddlIfNotResidential.SelectedValue, txtAllotmentNo.Text, Convert.ToDateTime(AllotDate), ddlPreviouslyAlloted.SelectedValue, 
                                             txtFavour.Text, DateTime.Parse(txtDateOfExecution.Text), DateTime.Parse(txtDateOfRegistration.Text), txtCoOptHousingSociaty.Text, 
                                             txtSociatyreg.Text, Convert.ToInt32(txtSalami.Text), Int32.Parse(txtInterestPaid.Text), Int32.Parse(txtBPValue.Text), 
                                             Int32.Parse(txtTotalValue.Text), Int32.Parse(txtBalenceDue.Text), DateTime.Parse(txtDateOfpossession.Text), txtCertificateNo.Text, 
                                             txtTypeOfPossession.Text, Int32.Parse(txtGroundRentPaidUpto.Text), Int32.Parse(txtGroundRentAmount.Text), Int32.Parse(TxtBalenceDueifAny.Text), 
                                             txtPlanSubmitted.Text, DateTime.Parse(txtOriginalDate.Text), txtNo.Text, txtRemarks.Text, 
                                             txtPlanSanctioned.Text, DateTime.Parse(txtDOSanctioned.Text), txtDOSanctionedNo.Text, DateTime.Parse(txtDORevisedSanction.Text), 
                                             txtDORevisedSanctionNo.Text, txtRemarksDORevised.Text, ddlTenYearsExpired.SelectedValue, DateTime.Parse(txtOriginalDate1.Text), 
                                             txttxtOriginalDate1.Text, Convert.ToDateTime(txtReviseddate1.Text), txtNoReviseddate1.Text, txtREmarksReviseddate1.Text, 
                                             txtStoreysPlanned.Text, urm_const_status.Text, txtNoofStorageComplete.Text, txtConstructionStroge.Text, 
                                             txtConstructionRemarks.Text, txtCGGrantedFloorwise.Text, ddlCommercialUtilisationDetails.SelectedValue, txtOtherUtilisation.Text, 
                                             ddlPublicUtilisationDetails.SelectedValue, txtOtherUtilisation1.Text, txtIndustrialutilisation.Text, ddlPlotLeaseOwnedBy.SelectedValue); 
                ResTableDataBind(); 
                ImageOk.Visible = true; 
                Msg.Text = "New Record Insert Sucessfully"; 
                ClearMain(); 
    //Insert Operation 
            public static int Insert( String sector,String block,String plot,DateTime urm_entry_dt, 
                                      String urm_loc_adv,String urm_alott_catg,Int32 urm_grnd_rent,String urm_grnd_rent_pp, 
                                      String urm_grnd_rent_desc,String urm_resi,String urm_shop_allowed,String urm_yes_resi, 
                                      String urm_non_resi,String urm_allot_no,DateTime urm_allot_dt,String urm_prev_alloted, 
                                      String urm_whose_fav,DateTime urm_reg_dt,DateTime urm_exe_dt,String urm_coop_name, 
                                      String urm_coop_reg_no,Int32 urm_org_cost,Int32 urm_interest_paid,Int32 urm_bp_cost, 
                                      Int32 urm_amount_paid,Int32 urm_bal_due,DateTime urm_poss_dt, String urm_poss_cert_no, 
                                      String urm_poss_type,Int32 urm_grnd_rentupto_yr,Int32 urm_grnd_rent_paid,Int32 urm_grnd_rent_bal, 
                                      String urm_pln_submitted,DateTime urm_pln_subm_org_dt,String urm_pln_subm_org_no,String urm_pln_subm_rem  , 
                                      String urm_pln_sanctioned,DateTime urm_pln_sanc_org_dt,String urm_pln_sanc_no, DateTime urm_pln_sanc_rev_dt, 
                                      String urm_pln_sanc_rev_no,String urm_pln_sanc_rem, String urm_tenyr_exp,DateTime urm_tenyr_org_dt, 
                                      String urm_tenyr_org_no,DateTime urm_tenyr_rev_dt, String urm_tenyr_rev_no, String urm_tenyr_rem,  
                                      String urm_pln_storeys,String urm_const_status,String urm_comp_storeys, String urm_const_storeys  ,  
                                      String urm_const_rem,String urm_cc_rem,String urm_comm_util,String urm_comm_util_other  ,  
                                      String urm_pub_util,String urm_pub_util_other,String urm_ind_util1,String urm_plot_lease_ownby) 
                DBAccess db = new DBAccess(); 
                SqlParameter objParam = new SqlParameter("@urm_id", 0); 
                objParam.Direction = ParameterDirection.Output;             
                db.Parameters.Add(new SqlParameter("@upm_sector", sector)); 
                db.Parameters.Add(new SqlParameter("@upm_block", block)); 
                db.Parameters.Add(new SqlParameter("@upm_plot", plot)); 
                db.Parameters.Add(new SqlParameter("@urm_entry_dt", urm_entry_dt)); 
                db.Parameters.Add(new SqlParameter("@urm_loc_adv", urm_loc_adv)); 
                db.Parameters.Add(new SqlParameter("@urm_alott_catg", urm_alott_catg)); 
                db.Parameters.Add(new SqlParameter("@urm_grnd_rent", urm_grnd_rent)); 
                db.Parameters.Add(new SqlParameter("@urm_grnd_rent_pp", urm_grnd_rent_pp)); 
                db.Parameters.Add(new SqlParameter("@urm_grnd_rent_desc", urm_grnd_rent_desc)); 
                db.Parameters.Add(new SqlParameter("@urm_resi", urm_resi)); 
                db.Parameters.Add(new SqlParameter("@urm_shop_allowed", urm_shop_allowed)); 
                db.Parameters.Add(new SqlParameter("@urm_non_resi", urm_non_resi)); 
                db.Parameters.Add(new SqlParameter("@urm_yes_resi", urm_yes_resi)); 
                db.Parameters.Add(new SqlParameter("@urm_allot_no", urm_allot_no)); 
                db.Parameters.Add(new SqlParameter("@urm_allot_dt", urm_allot_dt)); 
                db.Parameters.Add(new SqlParameter("@urm_reg_dt", urm_reg_dt)); 
                db.Parameters.Add(new SqlParameter("@urm_exe_dt", urm_exe_dt)); 
                db.Parameters.Add(new SqlParameter("@urm_coop_name", urm_coop_name)); 
                db.Parameters.Add(new SqlParameter("@urm_coop_reg_no", urm_coop_reg_no)); 
                db.Parameters.Add(new SqlParameter("@urm_org_cost", urm_org_cost)); 
                db.Parameters.Add(new SqlParameter("@urm_bp_cost", urm_bp_cost)); 
                db.Parameters.Add(new SqlParameter("@urm_interest_paid", urm_interest_paid)); 
                db.Parameters.Add(new SqlParameter("@urm_amount_paid", urm_amount_paid)); 
                db.Parameters.Add(new SqlParameter("@urm_bal_due", urm_bal_due)); 
                db.Parameters.Add(new SqlParameter("@urm_poss_dt", urm_poss_dt)); 
                db.Parameters.Add(new SqlParameter("@urm_poss_cert_no", urm_poss_cert_no)); 
                db.Parameters.Add(new SqlParameter("@urm_poss_type", urm_poss_type)); 
                db.Parameters.Add(new SqlParameter("@urm_grnd_rentupto_yr", urm_grnd_rentupto_yr)); 
                db.Parameters.Add(new SqlParameter("@urm_grnd_rent_paid", urm_grnd_rent_paid)); 
                db.Parameters.Add(new SqlParameter("@urm_grnd_rent_bal", urm_grnd_rent_bal)); 
                db.Parameters.Add(new SqlParameter("@urm_pln_submitted", urm_pln_submitted)); 
                db.Parameters.Add(new SqlParameter("@urm_pln_subm_org_dt", urm_pln_subm_org_dt)); 
                db.Parameters.Add(new SqlParameter("@urm_pln_subm_org_no", urm_pln_subm_org_no)); 
                db.Parameters.Add(new SqlParameter("@urm_pln_subm_rem", urm_pln_subm_rem));             
                db.Parameters.Add(new SqlParameter("@urm_pln_sanctioned", urm_pln_sanctioned)); 
                db.Parameters.Add(new SqlParameter("@urm_pln_sanc_org_dt", urm_pln_sanc_org_dt)); 
                db.Parameters.Add(new SqlParameter("@urm_pln_sanc_no", urm_pln_sanc_no)); 
                db.Parameters.Add(new SqlParameter("@urm_pln_sanc_rem", urm_pln_sanc_rem)); 
                db.Parameters.Add(new SqlParameter("@urm_pln_sanc_rev_dt", urm_pln_sanc_rev_dt)); 
                db.Parameters.Add(new SqlParameter("@urm_pln_sanc_rev_no", urm_pln_sanc_rev_no)); 
                db.Parameters.Add(new SqlParameter("@urm_const_status", urm_const_status)); 
                db.Parameters.Add(new SqlParameter("@urm_const_storeys", urm_const_storeys)); 
                db.Parameters.Add(new SqlParameter("@urm_pln_storeys", urm_pln_storeys)); 
                db.Parameters.Add(new SqlParameter("@urm_comp_storeys", urm_comp_storeys)); 
                db.Parameters.Add(new SqlParameter("@urm_const_rem", urm_const_rem)); 
                db.Parameters.Add(new SqlParameter("@urm_comm_util", urm_comm_util)); 
                db.Parameters.Add(new SqlParameter("@urm_comm_util_other", urm_comm_util_other)); 
                db.Parameters.Add(new SqlParameter("@urm_pub_util", urm_pub_util)); 
                db.Parameters.Add(new SqlParameter("@urm_pub_util_other", urm_pub_util_other)); 
                db.Parameters.Add(new SqlParameter("@urm_ind_util1", urm_ind_util1)); 
                db.Parameters.Add(new SqlParameter("@urm_plot_lease_ownby", urm_plot_lease_ownby)); 
                db.Parameters.Add(new SqlParameter("@urm_prev_alloted", urm_prev_alloted)); 
                db.Parameters.Add(new SqlParameter("@urm_whose_fav", urm_whose_fav));             
                db.Parameters.Add(new SqlParameter("@urm_tenyr_exp", urm_tenyr_exp)); 
                db.Parameters.Add(new SqlParameter("@urm_tenyr_org_dt", urm_tenyr_org_dt)); 
                db.Parameters.Add(new SqlParameter("@urm_tenyr_org_no", urm_tenyr_org_no)); 
                db.Parameters.Add(new SqlParameter("@urm_tenyr_rev_dt", urm_tenyr_rev_dt)); 
                db.Parameters.Add(new SqlParameter("@urm_tenyr_rev_no", urm_tenyr_rev_no)); 
                db.Parameters.Add(new SqlParameter("@urm_tenyr_rem", urm_tenyr_rem)); 
                db.Parameters.Add(new SqlParameter("@urm_cc_rem", urm_cc_rem)); 
                db.Parameters.Add(objParam); 
                int retval = db.ExecuteNonQuery("InsertResMasterNEW"); 
                if (retval == 1) 
                    return int.Parse(objParam.Value.ToString()); 
                else 
                    return -1; 
    Please help
    Thanks

    Hi, 
    I am having the samen problem as described by Gaurab. I get this
     error 'SqlDateTime overflow'. I have been looking for a few hours now online and can't find a solution.
    I am not an expert in ASP.NET but I have to fix this problem as it is a school assignment. 
    I am indeed trying to insert the data into my DB with this command:
    Cmd.Parameters.AddWithValue("@Birthday", subscribe.BIRTHDAY);
    The subscribe.BIRTHDAY part comes from my BO class, where I do this:
    public DateTime BIRTHDAY {
                get { return geboortedatum; }
                set { geboortedatum =
    value; }
    How can I check the DateTime variable i'm passing to the DB? How can I see in what format it is sending or how can I see what my DB expects it to be? 
    Many thanks
    - Nicolas

  • I Need help in my android application please, There is an error while we run it on HD high resolution only while on other device with low resolution it is work properly

    class MyDragListener implements View.OnDragListener {
            Drawable enterShapeAcp = getResources().getDrawable(R.drawable.shape_droptargetacp);
            Drawable enterShapeRej= getResources().getDrawable(R.drawable.shape_droptargetrej);
            Drawable normalShape = getResources().getDrawable(R.drawable.shape);
            @Override
            public boolean onDrag(View v, DragEvent event) {
               // int action = event.getAction();
                switch (event.getAction()) {
                case DragEvent.ACTION_DRAG_STARTED:{
                    break;}
                case DragEvent.ACTION_DRAG_ENTERED:{
                    grid(v.getX(),v.getY());
                    if(x[a][b]==false){
                        v.setBackgroundDrawable(enterShapeAcp);
                    if(x[a][b]==true){
                        v.setBackgroundDrawable(enterShapeRej); }
                    break;}
                case DragEvent.ACTION_DRAG_EXITED:{
                    v.setBackgroundDrawable(normalShape);
                    break;}
                case DragEvent.ACTION_DROP:{
                    grid(v.getX(),v.getY());
                    View view = (View) event.getLocalState();
                    if(x[a][b]==true){
                        view.setVisibility(View.VISIBLE);
                    else{
                        ViewGroup owner = (ViewGroup) view.getParent();
                        owner.removeView(view);
                        LinearLayout container = (LinearLayout) v;
                        container.addView(view);
                        view.setVisibility(View.VISIBLE);
                        x[a][b]=true;
                        x[m][n]=false;
                        grid(v.getX(),v.getY());
                        if(view.getId()==R.id.a){
                            if(a==0 && b== 0){
                                posA=true;}
                            else{
                                posA=false;}} 
                        if(view.getId()==R.id.b){
                            if(a==1 && b== 0){
                                posB=true;}
                            else{
                                posB=false;}} 
                        if(view.getId()==R.id.c){
                            if(a==2 && b== 0){
                                posC=true;}
                            else{
                                posC=false;}}
                        if(view.getId()==R.id.d){
                            if(a==3 && b== 0){
                                posD=true;}
                            else{
                                posD=false;}}
                        if(posA == true && posB == true &&posC == true &&posD == true){              
                          /*  toast  = Toast.makeText(getApplicationContext(),  " ****** \n DONE \n ******", Toast.LENGTH_SHORT);
                            toast.setGravity(Gravity.CENTER, 0, 0);
                            toast.show();*/
                        mm = MediaPlayer.create(getApplicationContext(), R.raw.msn);
                        mm.start();
                        v1.startAnimation(animRotate);
                        v2.startAnimation(animRotate);
                        v3.startAnimation(animRotate);
                        v4.startAnimation(animRotate);
                        /* toast  = Toast.makeText(getApplicationContext(), a +  "<><><>" + b , Toast.LENGTH_SHORT);
                         toast.setGravity(Gravity.CENTER, 0, 0);
                         toast.show();*/
                        }//else  
                     break;}
                case DragEvent.ACTION_DRAG_ENDED:{
                   v.setBackgroundDrawable(normalShape);
                   break;}  
                default:{
                     break;}
                 }//switch
                return true;
            }//onDrag
        }//class MyDragListener
    }//main class DragDropTest

    Cross-posted
    Here
    and here
    and also here
    and seems to be what might be a school assignment pasted early in 2013

Maybe you are looking for

  • Having issues with custom master pages and device channels

    I'm working in Sharepoint 2013 and am attempting to create a custom master page that is to be used by mobile devices. I have created an html file and a custom css file that includes snippets from the design manager. The file appears to preview fine i

  • How to set a password on a folder

    I was wondering if it is possible to protect a folder with a password. Let's say I don't want to create an account for other users. They use my account when using my Mac. But I have a folder I don't want them to access. Is it doable?

  • Info about AD Domain Controller to which I'm connected

    Hi, Is there a way to find the AD Domain Controller to which I'm connected ? Some time I find the info in these file : /Library/Preferences/OpenDirectory/DynamicData/Active Directory/<MYDOMAIN>.plist under 'last used server' but this field is not alw

  • How to pass command-line options to app using the "open" command?

    I am using jedit, and since I'm doing a lot of stuff in a shell, I'd really like to launch it from the command line as though I'd opened from finder, so I wrote a script that contains this: open -a /Applications/Jedit.app "$@" & This works well for e

  • Case, decode functions

    Dear All, Im having the table like the following, i need ther report like if i give role ,region and segment mean then i need onmenuid 2 alone. if input is role and region alone the i need those combinations result alone . if the input is role alone