Hello again, I am now encountering the above problem.
i dunno what to do and tried everything.
my Column for Capital is decimal so i dunno why it is saying varchar.
my codes are
con.ConnectionString = //insert data source;
if (con.State != ConnectionState.Closed)
{
con.Close();
}
cmd.Connection = con;
cmd.CommandText = "SELECT CAPITAL FROM TblProduct WHERE Description='" + descd.Text + "'and Price='" +upd.Text + "'";
con.Open();
dr = cmd.ExecuteReader();
int cap_d = dr.GetOrdinal("CAPITAL");
while (dr.Read())
{
cap_dvalue.Text = Convert.ToString(dr[cap_d]);
}
con.Close();
dr.Close();