Try this one
Certainly it seams that you don't have return type int so this error occurs
LastId = Convert.ToInt32(ds.Tables[0].Columns[0].ToString()==""?"0":ds.Tables[0].Columns[0].ToString());
This may help you
or
Inspect it properly and coonfirm that there is not string value return type
regards.....:)