
asp.net : 게시 설정 저장
- 👩🏻💻 프로그래밍/C#_ASP
- · 2019. 7. 31.
Dapper를 사용할 때 insert시 pk를 자동으로 채워주려면 해당 변수를 [Key] 로 해줘야함 ex) public class ItemEntity { [Key] public long ItemIdx {get;set;} public long InsertToDB() { conn.Insert(this); return ItemIdx; } } - explicitKey키로 어트리뷰트를 하면 위의 방법은 적용되지 않음 [추가 + ] [key] : "데이터베이스에서 자동으로 생성되는 키로 속성 지정"으로 정의 ( Auto Increment) [Explicti Key] : 키는 키인데 자동 증가 하지 않는 컬럼 https://stackoverflow.com/questions/49428967/dappers-explic..
에러 내용 you are using safe update mode and you tried to update a table without a WHERE that uses a key column To disable safe mode, toggle the option in Preferecnces -> SQL queries and reconnect. 해결 방법 > query SET SQL_SAFE_UPDATES = 0;
- 본인 pc localIP 받는 코드. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 string GetLocalIP() { string result = string.Empty; var host = Dns.GetHostEntry(Dns.GetHostName()); foreach (var ip in host.AddressList) { if (ip.AddressFamily == AddressFamily.InterNetwork) { result = ip.ToString(); break; } } return result; } er
Main 함수 using System; using System.Collections.Generic; namespace Study { class Program { static void Main(string[] args) { // IAnimal 리스트 var list = new List(); // type.GetType 으로 Cat 객체 생성 var animal = Type.GetType("Study.Cat"); var cat = Activator.CreateInstance(animal) as Cat; cat.Name = "고양이"; list.Add(cat); // type.GetType 으로 Dog 객체 생성 animal = Type.GetType("Study.Dog"); var dog = Activato..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 12..