Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

sqlite concat string issue

AMNishanthiKumariAMNishanthiKumari USMember ✭✭✭
edited January 10 in Xamarin.Forms

I need to add string to Order Number. I added like this. But i am getting only order number without string. I tried it with || also its return 0.

var data = conn.Query<Orders>("SELECT DateTime,('ORD-' + OrderId) AS OrderId, Total FROM Orders");

Best Answer

  • AMNishanthiKumariAMNishanthiKumari USMember ✭✭✭
    edited January 11 Accepted Answer

    I Found it

    public string OrderNumber { get { return string.Format("{0} - {1} ", "ORD", OrderId); } }

Answers

  • AndyFlisherAndyFlisher GBBeta, University ✭✭✭✭

    First thought, you appear to be using the alias OrderId which is also your column name, try removing the alias or using something unique and see if that helps

  • AMNishanthiKumariAMNishanthiKumari USMember ✭✭✭
    edited January 11 Accepted Answer

    I Found it

    public string OrderNumber { get { return string.Format("{0} - {1} ", "ORD", OrderId); } }

  • AndyFlisherAndyFlisher GBBeta, University ✭✭✭✭

    That will also work!

Sign In or Register to comment.