Glih to imam pri roki:
using (SqlConnection conn = new SqlConnection(connectionString)) using (SqlCommand cmd = new SqlCommand(
using (SqlCommand cmd = new SqlCommand(
using (SqlCommand cmd = new SqlCommand(@"
INSERT INTO Tracking (InstanceId, ActivityId, UserName, ActivityName, ActionType, IsTimeout) VALUES
(@InstanceId, @ActivityId, @UserName, @ActivityName, @ActionType, @IsTimeout)", conn)) { cmd.Parameters.AddWithValue("@InstanceId", parameters.InstanceId); cmd.Parameters.AddWithValue("@ActivityId", activityId); cmd.Parameters.AddWithValue("@UserName", user == null ? DBNull.Value: (object)user); cmd.Parameters.AddWithValue("@ActivityName", activityName); cmd.Parameters.AddWithValue("@ActionType", actionType.ToString()); cmd.Parameters.AddWithValue("@IsTimeout", isTimeout); conn.Open(); cmd.ExecuteNonQuery(); } Ni ravno select, je pa dinamičen.
{
cmd.Parameters.AddWithValue("@InstanceId", parameters.InstanceId); cmd.Parameters.AddWithValue("@ActivityId", activityId); cmd.Parameters.AddWithValue("@UserName", user == null ? DBNull.Value: (object)user); cmd.Parameters.AddWithValue("@ActivityName", activityName); cmd.Parameters.AddWithValue("@ActionType", actionType.ToString()); cmd.Parameters.AddWithValue("@IsTimeout", isTimeout); conn.Open(); cmd.ExecuteNonQuery(); } Ni ravno select, je pa dinamičen.
cmd.Parameters.AddWithValue("@ActivityId", activityId); cmd.Parameters.AddWithValue("@UserName", user == null ? DBNull.Value: (object)user); cmd.Parameters.AddWithValue("@ActivityName", activityName); cmd.Parameters.AddWithValue("@ActionType", actionType.ToString()); cmd.Parameters.AddWithValue("@IsTimeout", isTimeout); conn.Open(); cmd.ExecuteNonQuery(); } Ni ravno select, je pa dinamičen.
cmd.Parameters.AddWithValue("@UserName", user == null ? DBNull.Value: (object)user); cmd.Parameters.AddWithValue("@ActivityName", activityName); cmd.Parameters.AddWithValue("@ActionType", actionType.ToString()); cmd.Parameters.AddWithValue("@IsTimeout", isTimeout); conn.Open(); cmd.ExecuteNonQuery(); } Ni ravno select, je pa dinamičen.
cmd.Parameters.AddWithValue("@ActivityName", activityName); cmd.Parameters.AddWithValue("@ActionType", actionType.ToString()); cmd.Parameters.AddWithValue("@IsTimeout", isTimeout); conn.Open(); cmd.ExecuteNonQuery(); } Ni ravno select, je pa dinamičen.
cmd.Parameters.AddWithValue("@ActionType", actionType.ToString()); cmd.Parameters.AddWithValue("@IsTimeout", isTimeout); conn.Open(); cmd.ExecuteNonQuery(); } Ni ravno select, je pa dinamičen.
cmd.Parameters.AddWithValue("@IsTimeout", isTimeout); conn.Open(); cmd.ExecuteNonQuery(); } Ni ravno select, je pa dinamičen.
conn.Open();
cmd.ExecuteNonQuery();
}
Ni ravno select, je pa dinamičen.