In database i have column of type uniqueidentifier.i am using GUID type variable to pass value as input parameter to SQL query,but i is throwing format exception.
please help me in fixing this,i tried everything,but not able to fix this.This is the code i am trying
public static int GetNextMenuOrder(string applicationName, Guid parentItemId)
{
int maxMenuorder = 0;
IDataHandler ObjDataHandler = DataHandlerFactory.GetDataHandler(new Config(applicationName));
try
{
string query = "SELECT MAX(MenuOrder) FROM SKENavigationDetails where Application= @p_RepositoryName and ParentItemId=@ParentItemId";
IDataParameter parRepositoryName = ObjDataHandler.GetParameter("@p_RepositoryName", applicationName);
IDataParameter paramParentItemId = ObjDataHandler.GetParameter("@ParentItemId", parentItemId);
maxMenuorder = ObjDataHandler.ExecuteScalar(query, parRepositoryName, paramParentItemId);
}
cat ...
Go to the complete details ...