Add reference system. enterpriseservices. dll
Using system. enterpriseservices;
Create a button as needed and perform the following operations in the button:
Try
{
Work1 ();
Work2 ();
Contextutil. setcomplete ();
}
Catch (system. Exception doesn't)
{
Contextutil. setabort ();
Response. Write (Response T. Message );
}
then add two operations on the page to simulate calling operations of different classes at the logic layer
private void work1 ()
{< br> sqlconnection conn = new sqlconnection (system. configuration. configurationsettings. appsettings ["conn"]);
sqlcommand cmd1 = new sqlcommand ("insert into trantest (ID, test) values (1, 'test')", Conn );
Conn. open ();
statement 1.executenonquery ();
Conn. close ();
}
private void work2 ()
{< br> sqlconnection conn = new sqlconnection (system. configuration. configurationsettings. appsettings ["conn"]);
sqlcommand cmd2 = new sqlcommand ("insert into trantest (ID, test) values (2, 'test')", Conn );
Conn. open ();
limit 2.executenonquery ();
Conn. close ();
}