본문 바로가기
300x250

C#/Winform34

C# / SQLITE Database is not open 에러 발생했을 때 해결 방법 위의 그림과 같이 Database is not open 이라는 에러가 발생했을 때의 해결 방법 입니다. using (SQLiteConnection connection = new SQLiteConnection(connectionString)) 아래의 코드에 connection.Open()이라는 코드를 추가해주면 됩니다. 즉 connection이 오픈 되지 않아 생기는 에러 입니다. 2019. 11. 11.
C# / Winform DataGridView에 데이터 삭제하는 메서드 DataGridView에 데이터 삭제하는 메서드 입니다 삭제 시 데이터소스를 null로 변경 후 다시 새로운 데이터 소스를 삽입합니다. 그래야 삭제 시 에러 발생 안됨 혹은 e.Cancel = true로 설정하는데 이 항목은 테스트 안해봤음 #region mainDeleteButton_Click(sender, e) /// /// 삭제 버튼 클릭시 동작합니다. /// /// 이벤트 발생자 입니다. /// 이벤트 인자 입니다. private void mainDeleteButton_Click(object sender, EventArgs e) { foreach (DataGridViewRow row in this.mainGridView.SelectedRows) { MainModel focusItem = row.D.. 2019. 11. 10.
C# / Winform DataGridView에서 선택한 행의 객체 가져오기 DataGridView에서 선택한 행의 객체 가져오기 입니다. foreach (DataGridViewRow row in this.mainGridView.SelectedRows) { MainModel item = row.DataBoundItem as MainModel; UpdateMainControlData(item); } 2019. 11. 10.
C# / Winform 프로그레스바(Progress Bar) 입니다. Winform 프로그레스바 입니다. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WinformApp { public partial class MainForm : Form { private int number = 0; private string orgString = ""; /// /// 생성자 입니다. /// public MainForm() { Initia.. 2019. 10. 27.
300x250