Does spaces in mssql statement prevent it from working well
double yield1 = Convert.ToDouble(Session["qpr"]);
double yi1 = input1 / yield1;
string updateSQL;
updateSQL = "update stock set qtyprod ='" + input1 + "' , lastprod ='" + input1 + "' ,totalrev='" + yi1 + "' where no='" + name + "' and active ='1' ";
dbConn.ConnectionString = WebConfigurationManager.ConnectionStrings["DB_SCH"].ConnectionString;
cmd.Connection = dbConn;
cmd.CommandText = updateSQL;
cmd.CommandType = CommandType.Text;
try
{
dbConn.Open();
int updated = cmd.ExecuteNonQuery();
if (updated == 1)
{
// Response.Redirect("changepassw.aspx");
}
else
{
// Label101.Text = "Process not Completed";
}
dbConn.Close();
}
catch (Exception err)
{
Response.Write(err.ToString());
}
finally
{
dbConn.Close();
}
dr1.Close();
}
catch (Exception err)
{
Response.Write(err.ToString());
}
finally
{
dbConn1.Close();
}