Solved

stringbuilder problem

Posted on 2006-11-04
2
226 Views
Last Modified: 2010-04-16
Hi

I have this code

  public static Collection<RequestView> GetOpenRequests(Guid userID)
        {
            StringBuilder s = new StringBuilder();
            s.Append("RequestorID = ");
            s.Append(userID.ToString); <-----

            s.Append(" AND StartDate >= ");
            s.Append(System.DateTime.Today.ToUniversalTime);  <-----
            s.Append(" AND RecorderID IS NULL");

but i'm getting this error on the highlighted lines
cannot convert from 'method group' to 'string'

i dont know what the problem is

thanks
andrea
0
Comment
Question by:andieje
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 17873901
public static Collection<RequestView> GetOpenRequests(Guid userID)
        {
            StringBuilder s = new StringBuilder();
            s.Append("RequestorID = ");
            s.Append(userID.ToString());

            s.Append(" AND StartDate >= ");
            s.Append(System.DateTime.Today.ToUniversalTime.ToString());  
            s.Append(" AND RecorderID IS NULL");
0
 

Author Comment

by:andieje
ID: 17874127
that will teach me - vb.net puts the brackets it - it's made me lazy!
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question