UPDATE [Account] SET Status = 'Accept' WHERE Name = 'Name'
select Status from [Account] WHERE Name = 'Name'
SELECT Status UPDATE [Account] SET Status = 'Accept' WHERE Name = Name
Name
error is because you have not mention to select status where to pick, if you want update and get record first update than get as here SqlConnection con = new SqlConnection(@"data source=My\SQLEXPRESS;initial catalog=Test;integrated security=True;"); con.Open(); SqlCommand cmd = new SqlCommand("update FIFAWorldCup set WinningCountryName='Germany' where CountryID=7 select WinningCountryName from FIFAWorldCup", con); // SqlDataAdapter da = new SqlDataAdapter(cmd); // DataSet ds=new DataSet(); // da.Fill(ds); cmd.ExecuteNonQuery(); but if you are selecting table than use dataset insted of cmd.ExecuteNonQuery(); happy coding cheeerrrssss :) :) :)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)