| Author: D.Jeya kumar(JK) 20 Aug 2008 | Member Level: Diamond | Rating: Points: 3 |
hi,
Can you please modify the below line
Sql = "select max(Sno)+1 from M_company";
to
Sql = "select max(Sno)+1 as sno from M_company";
Let me know if you have any issues
Regards JK
|
| Author: ANIL PANDEY 20 Aug 2008 | Member Level: Diamond | Rating: Points: 2 |
Hi,
What is the Error u r getting as ur code seems to be OK.
if u specify the error i can try
Thanks Anil
|
| Author: Arun Rajan 20 Aug 2008 | Member Level: Gold | Rating: Points: 2 |
Jeya kumar's solution is right! But you may optimize your code by implementing ExecuteScalar instead of the DataSet object.
|
| Author: Misha 20 Aug 2008 | Member Level: Bronze | Rating: Points: 3 |
Hi,
Plz change ur sql command to like this Sql = "select max(Sno)+1 as Sno from M_company";
and use the same code as above, only change the command, select the max + 1 as Sno.
Hope this may help u. Regards, Misha
|