I am using Begining C# although I am fluent in VB6 to get up to speed however I am getting the error "Does not exist in current context"for sqltrans.Rollback.
I have 3 labels and 3 text boxes - textbox1 - 3. It works when I comment the rollback out though. Am I missing something basic or is the code wrong. I could easily code it out and carry on but that would not be helpful later on of course!
Thank you in advance...
[code]
using
namespace
{
InitializeComponent();
}
data source = .\sqlexpress;
integrated security = true;
database = Northwind
"
insert into customers(customerid,companyname)
values(@newcustid, @newconame) "
delete from customers
where customerid = @oldcustid"
conn.Open();
cmdins.CommandText = sqlins;
cmdins.Transaction = sqltrans;
cmdins.Parameters.Add(
System.Data.
cmddel.CommandText = sqldel;
cmddel.Transaction = sqltrans;
cmddel.Parameters.Add(
cmdins.Parameters[
cmdins.ExecuteNonQuery();
cmddel.Parameters[
cmddel.ExecuteNonQuery();
sqltrans.Commit();
sqltrans.Rollback();
conn.Close();
[/code]