티스토리 뷰
728x90
반응형
SqlDataReader DB연결된 동안 접근 가능(읽기 전용)
SqlDataAdapter DataSet에 복사, DB연결 끊어도 사용 가능
1. SqlDataReader 사용
SqlDataReader DB_reader_Eclass1 = Eclass_comm.ExecuteReader();
DataTable dt_Eclass1 = new DataTable();
dt_Eclass1.Load(DB_reader_Eclass1);
Eclass_comm.Parameters.Clear();
if (dt_Eclass1.Rows.Count > 0)
{
dataGrid1.ItemsSource = dt_Eclass1.AsDataView();
}
2. SqlDataAdapter 사용
DataSet DST = new DataSet();
SqlDataAdapter SDA = new SqlDataAdapter();
SDA.SelectCommand = Eclass_comm;
DataTable dt_Eclass1 = new DataTable();
SDA.Fill(dt_Eclass1);
Eclass_comm.Parameters.Clear();
if (dt_Eclass1.Rows.Count > 0)
{
dataGrid1.ItemsSource = dt_Eclass1.AsDataView();
}
반응형
'WPF' 카테고리의 다른 글
IP 할당(IPAddress) (0) | 2019.02.25 |
---|---|
contentpresenter checkbox casting error (0) | 2018.12.18 |
DataGrid 선택된 셀 좌표 (0) | 2018.12.11 |
item_list (126) | 2018.12.05 |
wpf progress bar (246) | 2018.12.05 |
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- SkiaSharp
- Xamarin SMS OTP Send
- Xamarin reCAPTCHA
- Xamarin.Ios Firebase Phone User Add
- Xamarin Firebase Phone User Add
- WPF Excel Export Microsoft.Office.Interop 성능향상(열 기준으로 복사)
- C# LINQ Left join
- 암호 마스터키
- ClickOnce 인증서 인증기간 변경
- Windows IIS FTP 디렉토리 목록 오류
- Microcharts
- Xamarin.Ios Firebase Phone SMS OTP Send
- Xamarin.Forms
- Xamarin.Ios Firebase Phone Auth
- 연산자 뒤에 피연산자가 없습니다.
- GetCellContent CheckBox Value
- Label Text LineBreak in Xaml
- FileStream Add Byte
- Entry '' has empty native path
- ssl_client_socket_impl.cc
- Embeded 한글Font적용
- Xamarin Firebase Phone Auth
- 서버 수준의 URN 필터
- Linux SSH Multi Computer Join
- c# Encrypt / Decrypt
- WPF Scrollviewer in ScrollViwer
- WPF Textbox
- WPF Datagrid Cell Value Change
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함