Hi!
I have three records: "search","product" and "stock".
When I make a search its show me the records searched on my textboxs ("produtoStocks.Text" and "nStocksStocks.Text"). Then when I am updating it's update only on column"product". Not on "stocks". why???
Please could you help pn it:
private void button1_Click(object sender, EventArgs e)
{
{
conn = new SqlConnection(connstr);
conn.Open();
comm = new SqlCommand("update searching set product= '" + produtoStocks.Text + ", stocks=' " + nStocksStocks.Text + "' where code = " + codigoBarraStocks.Text + " ", conn);// Its happen here
try
{
comm.ExecuteNonQuery();
MessageBox.Show("Dado atualizado com exito!");
}
catch (Exception)
{
MessageBox.Show("Dado não atualizado!");
}
finally
{
conn.Close();
}
}

VulpesRank #55 · 29.2K reputationPosted May 6, 2014, 9:20 AM EDT
Abhay ShankerRank #375 · 6.7K reputationPosted May 6, 2014, 3:39 AM EDT
do you get any error when you click button
IsraelRank #1,223 · 1.5K reputationPosted May 6, 2014, 7:37 AM EDT
The table name is: "Searching"
The structure table is:
Column Data type Alow null
Code numeric(18,20) yes
Product nchar(20) yes
nstocks numeric(18,20)
IsraelRank #1,223 · 1.5K reputationPosted May 6, 2014, 7:37 AM EDT
The table name is: "Searching"
The structure table is:
Column Data type Alow null
Code numeric(18,20) yes
Product nchar(20) yes
nstocks numeric(18,20)
IsraelRank #1,223 · 1.5K reputationPosted May 6, 2014, 7:41 AM EDT
The table name is: "Searching"
The structure table is:
Column Data type Alow null
Code numeric(18,20) yes
Product nchar(20) yes
nstocks numeric(18,20) yes
Then when I click the only error its given me is: "Not saved". That's all!
The code target on the button is: