public static void CreateSocialGroup(string FBUID) { string query = \"INSERT INTO SocialGroup (created_by_fbuid) VALUES (@FBUID); SELECT @@IDENTITY AS LastID\";
You can use ExecuteScalar to get the last value from a Sqlcommand.
The scope_identity() function is safer than @@identity.