Sunday, March 29, 2015

How to select a single value from a DB and attach to variable

Try this



private void button1_Click(object sender, EventArgs e) {
int price= 0;
using (SqlConnection con = new sqlConnection("tableConnectionString"))
{
SqlCommand cmd = new SqlCommand("INSERT INTO dbo.[Table] (MINOR) VALUES ('5555') WHERE Item = socket", con);
con.Open();

cmd.ExecuteNonQuery();
con.Close();

}





jdweng



No comments:

Post a Comment