.net core executenonqueryasync transaction
C#
var sqlQuery = "delete from table";
using (var connection = new SqlConnection(ConnectionString))
{
await connection.OpenAsync();
using (var tran = connection.BeginTransaction())
using (var command = new SqlCommand(sqlQuery, connection, tran))
{
try {
await command.ExecuteNonQueryAsync();
} catch {
tran.Rollback();
throw;
}
tran.Commit();
}
}
Also in C#:
- Title
- percentage in c#
- Category
- C#
- Title
- c# access session in class
- Category
- C#
- Title
- get and set for array c#
- Category
- C#
- Title
- c# string code ascii
- Category
- C#
- Title
- defualtsize UWP c#
- Category
- C#
- Title
- c# abstract class
- Category
- C#
- Title
- how to make infinite loop in c#
- Category
- C#
- Title
- split on uppercase c#
- Category
- C#
- Title
- query associative table ef6
- Category
- C#
- Title
- unity rotate around point
- Category
- C#
- Title
- pop up element from specific index in array
- Category
- C#
- Title
- visual studio clear text script
- Category
- C#
- Title
- how to trim path in C#
- Category
- C#
- Title
- How to set an expiry date on a program
- Category
- C#
- Title
- mailkit send attachment
- Category
- C#
- Title
- parsing string to int c#
- Category
- C#
- Title
- c# skip following code in loop
- Category
- C#
- Title
- sum the digits in c#
- Category
- C#
- Title
- cannot apply indexing with to an expression of type 'object'
- Category
- C#
- Title
- MVC creating a counter for products
- Category
- C#
- Title
- no overload for 'useItemOnSceneLoad' matches delegate 'UnityAction<Scene, LoadSceneMode>'
- Category
- C#
- Title
- c# if statement
- Category
- C#
- Title
- c# warning CS0108
- Category
- C#
- Title
- c# select first value from list
- Category
- C#
- Title
- check if two timespans intersect c#
- Category
- C#
- Title
- unity list length
- Category
- C#
- Title
- c# public static string
- Category
- C#
- Title
- never lose focus textbox c#
- Category
- C#
- Title
- unity try get component
- Category
- C#
- Title
- c# auto property set default value
- Category
- C#
- Title
- unity add component
- Category
- C#
- Title
- unity movetowards 2d
- Category
- C#
- Title
- return random from enum
- Category
- C#
- Title
- c# resize bitmap
- Category
- C#
- Title
- how to hide a panel ui unity
- Category
- C#
- Title
- can't add an editor script
- Category
- C#
- Title
- c sharp create dictionary
- Category
- C#
- Title
- c# download file
- Category
- C#
- Title
- modal dismiss
- Category
- C#
- Title
- reference to gameobject in different scene unity
- Category
- C#
- Title
- unity create primitive
- Category
- C#
- Title
- player script unity
- Category
- C#
- Title
- cursorlockmode cannot be used as a method C#
- Category
- C#
- Title
- unity deactivate scripts in list
- Category
- C#
- Title
- c# find duplicates in list
- Category
- C#
- Title
- native-googlesignin configuration is null!?
- Category
- C#
- Title
- dont destroy on load unity
- Category
- C#
- Title
- Exception thrown: 'System.FormatException' in mscorlib.dll dates
- Category
- C#
- Title
- how to make if statement c#
- Category
- C#
- Title
- c# ?
- Category
- C#
- Title
- unity how to change max fps
- Category
- C#
- Title
- mongodb c# batch find
- Category
- C#
- Title
- rotation unity script 2d
- Category
- C#
- Title
- add getenumerator to class c#
- Category
- C#
- Title
- how to hide and show object in unity script
- Category
- C#
- Title
- what is the and in c#
- Category
- C#
- Title
- get first and last item list c#
- Category
- C#
- Title
- unity next scene
- Category
- C#
- Title
- page parent wpf
- Category
- C#
- Title
- downlaod file and use C#
- Category
- C#
- Title
- .net identity seed users and roles
- Category
- C#
- Title
- .net core session
- Category
- C#
- Title
- how to a equall to b in c#
- Category
- C#
- Title
- c# communicate with arduino
- Category
- C#
- Title
- how to turn 3 floats into quartenion
- Category
- C#
- Title
- c sharp split by newline
- Category
- C#
- Title
- C# downloadstirng download old
- Category
- C#
- Title
- c# dictionary add
- Category
- C#
- Title
- f reachable queue in c#
- Category
- C#
- Title
- c# store generic type without arguments
- Category
- C#
- Title
- Replaced OS is obselete
- Category
- C#
- Title
- c# enum to int array
- Category
- C#
- Title
- cc# sort list with list if ids
- Category
- C#
- Title
- c# wpf row definition height * in code
- Category
- C#
- Title
- leantween sequence
- Category
- C#
- Title
- how to switch scenes unity
- Category
- C#
- Title
- dynamic in c#
- Category
- C#
- Title
- c# tab character
- Category
- C#
- Title
- c# merge two xml files
- Category
- C#
- Title
- c# add to array
- Category
- C#
- Title
- find gameobject with tag
- Category
- C#
- Title
- c# exit console
- Category
- C#
- Title
- stop unity editor playing
- Category
- C#
- Title
- c# string to byte array
- Category
- C#
- Title
- beard styles without mustache Intitle:work with me
- Category
- C#
- Title
- how to reference a child object unity
- Category
- C#
- Title
- letter at index of string c#
- Category
- C#
- Title
- string format c#
- Category
- C#
- Title
- Execute code every x seconds with Update()
- Category
- C#
- Title
- array to list C
- Category
- C#
- Title
- get list length c#
- Category
- C#
- Title
- install .net sdk ubuntu 20
- Category
- C#
- Title
- unity print to console
- Category
- C#
- Title
- c# capitalize first letter
- Category
- C#
- Title
- list of vectors c#
- Category
- C#
- Title
- c# remove specific character from string
- Category
- C#
- Title
- c# string list contains
- Category
- C#
- Title
- unity how to change the text on a button
- Category
- C#
- Title
- get enum value c#
- Category
- C#
- Title
- Request.ServerVariables["HTTP_X_FORWARDED_FOR"] get only one ipaddress
- Category
- C#