hi, I don't know if it is here but i hope that somebody help. I'm working in visual web developer in c# and i have a button, that when i click updates a row:
protected void Button3_Click(object sender, EventArgs e) { ObjectDataSource4.Select(); }
sql associated:
[WebMethod] public bool anu(int nnumdoc, int cliente) { //Ligação ConnectionString = "data source=" + txtIP + ";uid=" + txtUser + ";password=" + txtPass + ";database=" + txtNomeBD; SqlConnection myconnection = new SqlConnection(ConnectionString); SqlCommand cmd = new SqlCommand(); cmd.Connection = myconnection; //Update qstring = " if(Select DOCGCCAB.DATA+2" + " FROM DOCGCCAB INNER JOIN CLIENTES ON CLIENTES.CODIGO=DOCGCCAB.TERCEIRO" + " WHERE TPDOC='ENC' AND DOCGCCAB.NNUMDOC=" + nnumdoc + " AND NUMERO=" + cliente + ")>CURRENT_TIMESTAMP" + " BEGIN" + " UPDATE DOCGCCAB" + " SET NVIAS=-1" + " WHERE TPDOC='ENC' AND DOCGCCAB.NNUMDOC=" + nnumdoc + " AND TERCEIRO=(SELECT TOP 1 TERCEIRO FROM DOCGCCAB INNER JOIN" + " CLIENTES ON CLIENTES.CODIGO=DOCGCCAB.TERCEIRO" + " WHERE NUMERO=" + cliente + ")" + " END" + " ELSE" + " Select 'Não pode anular esta encomenda, o prazo limite foi ultrapassado(48 horas)' 'Aviso'"; cmd.CommandText = qstring; try { cmd.Connection.Open(); cmd.ExecuteNonQuery(); cmd.Connection.Close(); } catch (System.Data.SqlClient.SqlException err) { return false; } return (true); }
i want to know how i can print this page in my current web page.sorry in inglish