Thread: updating database

  1. #1
    Registered User datainjector's Avatar
    Join Date
    Mar 2002
    Posts
    356

    Question updating database

    okay i have a problem with my programm...i am using OleDb for my database .And updating the database is throwing an exception ...
    that states "no value given for one or more specific parameter"

    the code is
    Code:
    cmd.CommandText = @"UPDATE "+ client.GetKey(clientComboBox.SelectedIndex).ToString().Replace(' ','_').Replace(',','_') + @" SET Cno = Cno, [Date] = date,Origin = origin, Destination = destination, SenderAddress = senderAdd, ConAddress = conAdd, Dox = ""dox"", NonDox = nonDox, Express = express, AirCargo = airCargo, Surface = road, Kgms = kgms, Amount = amount WHERE Cno = str" ;

    cmd.ExecuteNonQuery();
    amount = cno = kgms are int
    the rest are strings
    Last edited by datainjector; 07-08-2003 at 05:14 PM.
    "I wish i could wish my wishs away"

    "By indirections find directions out" -- William Shakespears

    "Do what thou wilt shall be the whole of the law" -- Crowley "THE BEAST 666"

    Mizra -> love = Death...
    RDB(Rocks yooo)..

    http://www.cbeginnersunited.com

    Are you ready for the Trix ???

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    What does your statement look like, after your put it together ? Print the finished statement out to see what's wrong.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  3. #3
    Registered User datainjector's Avatar
    Join Date
    Mar 2002
    Posts
    356
    Actually, i got it..This was the problem

    I was only giving a huge string ..it should had been done this way


    NonDox ='" + nonDox + "', Express='" + express + "' " ... etc.

    DaIn
    "I wish i could wish my wishs away"

    "By indirections find directions out" -- William Shakespears

    "Do what thou wilt shall be the whole of the law" -- Crowley "THE BEAST 666"

    Mizra -> love = Death...
    RDB(Rocks yooo)..

    http://www.cbeginnersunited.com

    Are you ready for the Trix ???

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 07-07-2008, 07:48 AM
  2. Database binding and updating
    By elmidwill in forum C# Programming
    Replies: 1
    Last Post: 12-12-2007, 04:34 PM
  3. Creating a database
    By Shamino in forum Game Programming
    Replies: 19
    Last Post: 06-10-2007, 01:09 PM
  4. Developing database management software
    By jdm in forum C++ Programming
    Replies: 4
    Last Post: 06-15-2004, 04:06 PM
  5. Access database not updating correctly
    By MPSoutine in forum Windows Programming
    Replies: 1
    Last Post: 12-15-2003, 11:38 PM