Your Id column must be the primary key, Identity, and Auto Increments. Using Id = db.GetLastInsertId(); then should work. Try not using .ToString with db.GetLastInsertId(). You can convert the integer to a string later: var IdStr = Id.ToString();
Since we haven't heard from you for a long time, I temporarily close this case. I mark useful reply as answer. If you have any concerns, please free feel to reopen it or submit a new question. Thanks for your understanding.
Thanks
Best Regards
We are trying to better understand customer views on social support experience. Click HERE to participate the survey. Thanks!
Member
229 Points
662 Posts
db.GetLastInsertId().ToString();
Jul 26, 2013 08:33 AM|ssvikramuk|LINK
Below script is working ifne. But db.GetLastInsertId().ToString(); is not working. So whenever i upload the image it saving with out the id name.
Member
690 Points
185 Posts
Re: db.GetLastInsertId().ToString();
Jul 26, 2013 09:32 AM|dblaire|LINK
Your Id column must be the primary key, Identity, and Auto Increments. Using Id = db.GetLastInsertId(); then should work. Try not using .ToString with db.GetLastInsertId(). You can convert the integer to a string later: var IdStr = Id.ToString();
All-Star
23975 Points
4084 Posts
Re: db.GetLastInsertId().ToString();
Aug 05, 2013 08:16 AM|Starain chen - MSFT|LINK
Hi ssvikramuk,
Since we haven't heard from you for a long time, I temporarily close this case. I mark useful reply as answer. If you have any concerns, please free feel to reopen it or submit a new question. Thanks for your understanding.
Thanks
Best Regards