Could you provide a bit more information ...
the following example show how to update a particular customer's data based on
the value of txtCustName and the value of txtCustAddress
//assume there is a SqlConnection called myConnection
SqlCommand myCommand = new SqlCommand("", myConnection);
myCommand.CommandText = "UPDATE Customers SET CustomerData = @Data WHERE
CustomerName = @CusName AND CustomerAddress = @CusAddress";
myCommand.Parameters.Add(new SqlParameter(@CusName, txtCustName.Text);
myCommand.Parameters.Add(new SqlParameter(@CusAddress,
txtCustAddress.Text);
myCommand.Parameters.Add(new SqlParameter(@CusData, txtCustData.Text);
myCommand.Connection.Open();
myCommand.ExecuteNonQuery();
}
SqlDataAdapter is only used when u update the database from a dataset
cheers,
Ivan
"Jason Huang" wrote:
Hi,
I want to use the Sqlparameter and SqlDataAdapter to update my data,
and the data will be updated based on two TextBoxes txtCustName and
txtCustAddress.
Thanks for help.
Jason