Blog Content

  • 29.ADO.NET - Linq To SQL

    Category ASP.NET on 2009. 9. 30. 20:11

    Form1.Designer.cs private System.Windows.Forms.ListBox listBox1; AddressBook.cs [ Class 파일 추가 ] Linq를 사용하기 위해 참조추가를 합니다. namespace WinLinqToSQL { /// /// AddressBook 테이블과 일대일 매칭되는 클래스 /// [Table(Name="AddressBook")] // Table 특성 사용해서 테이블로 보자 public class AddressBook { private int _Num; [Column(IsPrimaryKey=true, Storage="_Num")] public int Num // Num 속성은 Num 컬럼과 매칭, 기본키 설정 { get { return _Num; } ..

    Read more
  • 28.ADO.NET - Linq To DataSet

    Category ASP.NET on 2009. 9. 30. 19:35

    Linq를 이용한 DataSet 입니다. Form1.Designer.cs private System.Windows.Forms.ListBox listBox1; private System.Windows.Forms.ListBox listBox2; private System.Windows.Forms.ListBox listBox3; Form1.cs namespace WinLinqToDataSet { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection( "server..

    Read more
  • 27.ADO.NET - Binding

    Category ASP.NET on 2009. 9. 30. 19:06

    바인딩(Binding) : 데이터 소스를 폼의 컨트롤과 연결하여 폼에 DB의 내용을 출력하는 기법 컨트롤과 DB과 연결되어 양방향으로 데이터가 오고 가는 것 DataBinding : 컨트롤에 대한 데이터 바인딩을 가져옴 Form1.Designer.cs private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextB..

    Read more
  • 26.ADO.NET - SqlCommandBuilder

    Category ASP.NET on 2009. 9. 30. 18:35

    SqlCommandBuilder : 연결된 SQL Server 데이터베이스에서 DataSet의 변경 내용을 조정하는데 사용되는 단일 테이블 명령을 자동으로 생성. 이 클래스는 상속될 수 없음 SqlDataAdapter는 SQL Server의 관련 인스턴스를 사용하여 DataSet의 변경을 조정하는 데 필요한 T-SQL문을 자동으로 생성. 그 러나 SqlDataAdapter의 SelectCommand속성을 설정하면, SqlCommandBuilder 개체를 만들어 단일 테이블 업데이트를 위한 T-SQL문을 자동으로 생성 가능. 그런 다음 설정하지 않은 추가 T-SQL문이 SqlCommandBuilder에 의해 생성 데이터 베이스 추가 Create Table AddressBook ( Num int identi..

    Read more
  • 25.ADO.NET - DataAdapter

    Category ASP.NET on 2009. 9. 30. 18:03

    DataAdapter : DataSet을 체우고 데이터 소스를 업데이트 하는데 사용되는 SQL 명령 집합 및 데이터 베이스 연결 Form1.Designer.cs private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.DataGridView dataGridView2; private System.Windows.Forms.Button btnSave; Form1.cs namespace DataAdapter { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender,..

    Read more
  • 24.ADO.NET - CommandTest

    Category ASP.NET on 2009. 9. 30. 12:22

    WinForm 에서 ADO ConnectionString문자열 연결하여 DB에 값을 입력/출력/수정/삭제 하는 예제입니다. Form1.Designer.cs private System.Windows.Forms.ListBox listBox1; private System.Windows.Forms.Button btnSelect; private System.Windows.Forms.Button btUpdate; private System.Windows.Forms.Button btnDelete; private System.Windows.Forms.Button btnSum; private System.Windows.Forms.TextBox txtCategoryName; private System.Windows.For..

    Read more
이전 1 다음