I want to fetch float data (if exist) from database and after addition show the result in text box (TXT_grandtotal
)
In my code its shows only numeric value
double price= 0;
DataTable dt = new DataTable();
cmd.CommandText = "select total from productADD where auto_no='"+txt_autoNo.Text.Trim() + "'";
cmd.Connection = con;
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
foreach (DataRow row in dt.Rows)
{
float id = (Convert.ToInt32(row["total"]));
price = id + price;
TXT_grandtotal.Text = (Convert.ToString(price));
}