Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends
i have suffering with the problem the error that i have occur is "Unrecognized Guid Format"
code is
C#
public Int32 getprpcount(string userplan,string plan)
{
    try
    {
        obj.conopen();
        SqlCommand cmd = new SqlCommand("property_by_plan", obj.con);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.Add("@userplan", SqlDbType.UniqueIdentifier).Value = new Guid(userplan);
        cmd.Parameters.Add("@plan", SqlDbType.NVarChar, 50).Value = plan;
        Int32 cnt = Convert.ToInt32(cmd.ExecuteScalar());
        return cnt;
    }
    catch { return 0; }
}
Posted

The 'Unrecognized Guid Format' is in the supplied string userplan, you have to check its format (or report its content here).
 
Share this answer
 
Hi ,

You need to parse that String Guid using

C#
R_Address.CityId = Guid.ParseExact(uim.rcityid, "D");


Like this you need to parse into Guid

All the Best
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900