I'm fairly new to asp.net so please be patient.. I've seen many examples online but I seem to have some trouble with this. I'm trying to create a db record with button1 with the current time, and update that record with button2 with the new current time. I got up to.. SqlCommandBuilder builder = new SqlCommandBuilder(adapter); then I put.. adapter.InsertCommand = builder.GetInsertCommand(); into the button1 click event.. what am I missing here?
button1 click event SQLHelper.ExecuteNonQuery("insert into tablename(field1,...) values(value1, ...)"); button2 click event SQLHelper.ExecuteNonQuery("update tablename set field1=value1, ... where id=" + id);
Ok but what is your insertcommand like? For instance if you want to read, SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = new SqlCommand(queryString, connection); <== SqlCommandBuilder builder = new SqlCommandBuilder(adapter);