View GridView details in label with parsian font in ASP.Net

Last Reply on Oct 26, 2016 03:12 AM By dharmendr

Posted on Oct 26, 2016 02:06 AM

hi

I used below code to show number in persian language:

string value = Lblpey.Text.Trim();
        char[] charArray = value.ToCharArray();
        Lblpey.Text = toPersianNumber(new string(charArray));

see below code:

  private void ViewOrderInfo(int data1)
    {
        using (SqlConnection conn = General.GetConnection())
        {
            using (SqlCommand _cmd = General.GetCommand("Order_ViewInfo", conn))
            {
                _cmd.Parameters.AddWithValue("@PeygiriCode", data1);
                conn.Open();
                SqlDataReader _dr = _cmd.ExecuteReader();
                while (_dr.Read())
                {
                    string valueK = Lblkol.Text.Trim();
                    char[] charArrayK = valueK.ToCharArray();
                    Lblkol.Text = toPersianNumber(new string(charArrayK));
                    Lblkol.Text = _dr["PriceTotalBaste"].ToString();
                    Lblprice.Text = _dr["PriceT"].ToString();
}
}
]

how I can merg below code to show number in persian?

 string valueK = Lblkol.Text.Trim();
                    char[] charArrayK = valueK.ToCharArray();
                    Lblkol.Text = toPersianNumber(new string(charArrayK));
                  

with

Lblkol.Text = _dr["PriceTotalBaste"].ToString();

these codes are in  ViewOrderInfo(int data1)

 

Best Regards

Neda

Posted on Oct 26, 2016 03:12 AM
nedash says:
private void ViewOrderInfo(int data1)
    {
        using (SqlConnection conn = General.GetConnection())
        {
            using (SqlCommand _cmd = General.GetCommand("Order_ViewInfo", conn))
            {
                _cmd.Parameters.AddWithValue("@PeygiriCode", data1);
                conn.Open();
                SqlDataReader _dr = _cmd.ExecuteReader();
                while (_dr.Read())
                {
                    string valueK = Lblkol.Text.Trim();
                    char[] charArrayK = valueK.ToCharArray();
                    Lblkol.Text = toPersianNumber(new string(charArrayK));
                    Lblkol.Text = _dr["PriceTotalBaste"].ToString();
                    Lblprice.Text = _dr["PriceT"].ToString();
}
}
]

Replace the above with the below code.

private void ViewOrderInfo(int data1)
{
    using (SqlConnection conn = General.GetConnection())
    {
        using (SqlCommand _cmd = General.GetCommand("Order_ViewInfo", conn))
        {
            _cmd.Parameters.AddWithValue("@PeygiriCode", data1);
            conn.Open();
            SqlDataReader _dr = _cmd.ExecuteReader();
            while (_dr.Read())
            {
                Lblkol.Text = toPersianNumber(_dr["PriceTotalBaste"].ToString());
                Lblprice.Text = toPersianNumber(_dr["PriceT"].ToString());
            }
        }
    }
}