namespace 주소록 public MainForm() //데이터 베이스 연결문자열 지정 |
SqlCommand cmd = new SqlCommand SqlDataAdapter da = new SqlDataAdapter(cmd); this.dgvAddress.DataSource = ds.Tables[0].DefaultView; if (ds.Tables[0].Rows.Count > 0) |
SqlConnection con = new SqlConnection(connectinonString); SqlCommand cmd = new SqlCommand(); cmd.Parameters.AddWithValue("@Name", txtName.Text); cmd.ExecuteNonQuery() ; //저장 |
MessageBox.Show("백업 완료"); // 종료 private int currentIndex = -1; //셀 클릭하였을 경우 선택한값 텍스트 박스에 표시 if (e.RowIndex < ds.Tables[0].Rows.Count) |
SqlCommand cmd = new SqlCommand(); cmd.Parameters.AddWithValue("@Name", txtName.Text); cmd.ExecuteNonQuery(); MessageBox.Show("수정되었습니다"); //삭제 SqlCommand cmd = new SqlCommand(); |
//이동 DataRow dr; this.dgvAddress.DataSource = ddv; |
'.Net Project > ADO.NET 3.5' 카테고리의 다른 글
15장 ADO.NET 윈폼에서 직접 테이블 작성 (0) | 2009.09.29 |
---|---|
14장 ADO.NET 메모리상의 데이터 베이스(Parameters) (0) | 2009.09.29 |
12장 ADO.NET 메모리상의 데이터 베이스(RowFilter) (0) | 2009.09.28 |
11장 ADO.NET 메모리상의 데이터 베이스(DataRow) (0) | 2009.09.28 |
10장 ADO.NET 메모리상의 데이터 베이스(View) (0) | 2009.09.28 |