How to Convert System.Guid to System.String in code?

Hi,

all I want is read value of the Guid type column in code and convert it to String, something like this:

String s_guid = Convert.ToString((Guid)Report.GetColumnValue("SQL_Move.acDiscountCouponGUID"));

But throws me conversion exception! Why??? How to read Guid column value??

Best Regards,
Matja??

Comments

  • edited 11:56PM
    Hi,

    all I want is read value of the Guid type column in code and convert it to String, something like this:

    String s_guid = Convert.ToString((Guid)Report.GetColumnValue("SQL_Move.acDiscountCouponGUID"));

    But throws me conversion exception! Why??? How to read Guid column value??

    Best Regards,
    Matja??

    Solved:

    private void dataDiscountCoupon_BeforePrint(object sender, EventArgs e)
    {
    Guid my_guid = Guid.Empty;
    try
    {
    my_guid = (Guid)Report.GetColumnValue("SQL_Move.acDiscountCouponGUID");
    }
    catch (Exception ex)
    {}
    subDiscountCoupon.Visible = my_guid != Guid.Empty;
    }

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.