I'm developing web application..inventory system..thanks for your help..i'll try other method to solved my problem..

I'm not going to claim to be an expert at everything SQL, however, when I write an UPDATE string I do it as follows:

string sqlQuery = "UPDATE tableRegister SET {StaffName,StaffID,Hostname,Department,etc...} VALUES {@TextBox1,@TextBox2,@TextBox3,etc...} WHERE SerialNo=@TextBox41"

I'm not 100% sure that your method using "StaffName=@TextBox1, StaffID=@TextBox2, [Hostname]=@TextBox3" to set the values of the updated components is valid.

Hope this helps :) Please mark as solved if it resolves your issue.

String sqlQuery = "UPDATE tableRegister SET (StaffName, StaffID, [Hostname], [Department], [Section], [Extension], Type, IpAddType, IpAdd,
MacAdd, CpuBrand, CpuModel, Processor, HardDisk, HDType, RAM, RAMType, MonBrand, MonModel, MonSerialNo, MouBrand, MouModel, MouSerialNo,
KeybBrand, KeybModel, KeybSerialNo, CdPlay, CdPlayBrand, CdPlayModel, CdPlayType, Windows, Other, WProdKey, MS, MSProdKey, SoftwareName,
LicenceNo, Remarks)
values
( @TextBox1, @TextBox2, @TextBox3, @TextBox4, @TextBox5, @TextBox6, TextBox40, @TextBox8, @TextBox9, @TextBox10, @TextBox11, @TextBox12,@TextBox13,
@TextBox14, @TextBox15, @TextBox16, @TextBox17, @TextBox18, @TextBox19, @TextBox20, @TextBox21, @TextBox22, @TextBox23, @TextBox24, @TextBox25,
@TextBox26, @TextBox27, @TextBox28, @TextBox29, @TextBox31, @TextBox32, @TextBox33, @TextBox34, @TextBox35, @TextBox36, @TextBox37, @TextBox38,
@TextBox39 )


WHERE SerialNo=@TextBox41";

i have just elaborated the above post,
I would ask u not to pass as string to numeric and integer values, instead convert them into integer or numeric, which ever suits, and then update it to the database, i suppose thats the place where you r getting an exception which is leading u to the popup msg 'Failed to update'...
'I hope this helps.

i have just elaborated the above post,
I would ask u not to pass as string to numeric and integer values, instead convert them into integer or numeric, which ever suits, and then update it to the database, i suppose thats the place where you r getting an exception which is leading u to the popup msg 'Failed to update'...
'I hope this helps.

arunkumars;
In one of my other posts I already brought up the issue of incorrect value types being passed but it was never answered as to what data types were being used for each column in the table.

Also, this thread has been (inadvertently) continued in this new thread so please focus any further attempts to solve this issue there as more progress seems to have been made in that thread than here :P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.