Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- SQL개발자
- mtv패턴
- sqld요약
- 아두이노
- 역순출력
- 코딩연습
- BeutifulSoup
- trycatch문
- SQL전문가
- sqld1과목
- istqb-al
- Oracle
- SQLD
- 완전수
- C#함수
- 람다식
- 대리자
- 라즈베리파이
- c#
- ISTQB
- 파이썬
- sqld요점정리
- Django
- Python
- 질의작성기
- outerjoin
- db개발자
- 데이터삽입
- 랜덤수출력
- 저장프로시저
Archives
- Today
- Total
JIMINOTE
[C#/Mysql] 데이터 연결하기 본문
oracle과 연동하는 코드↓
https://j-passionote.tistory.com/12
[C#/Oracle] 데이터 삽입하기
Dept_temp 테이블에 더보기 99번째 부서 부서이름 TECH 위치 ANDONG 데이터를 삽입. namespace MyOracleTest02 { class Program { /* * 1. NuGet 패키지 다운로드 * 2. 연결 객체, 스크립트 완성하기 * 3. 테스트..
j-passionote.tistory.com
-emp_info 테이블의 데이터를 datagridview 표에 띄우는 부분
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;
using MySql.Data.MySqlClient;
namespace TestForm
{
public partial class Man_Page : Form
{
public string strConn = "Server=192.168.0.31;" +
"Database=test;" +
"Uid=유저아이디;" +
"Pwd=비밀번호;" +
"charset=utf8;";
public MySqlConnection conn;
public MySqlCommand cmd;
public MySqlDataReader rdr;
private void Man_Page_Load(object sender, EventArgs e)
{
conn = new MySqlConnection(strConn);
cmd = new MySqlCommand();
conn.Open();
cmd.Connection = conn;
cmd.CommandText = ("select * from emp_info order by emp_id");
rdr = cmd.ExecuteReader();
StringBuilder sb = new StringBuilder();
while (rdr.Read())
{
string Emp_id = rdr["emp_id"] as string;
string Emp_name = rdr["emp_name"] as string;
string Emp_email = rdr["emp_email"] as string;
string Emp_tel = rdr["emp_tel"] as string;
string Emp_addr = rdr["emp_addr"] as string;
string Emp_emer_tel = rdr["emp_emer_tel"] as string;
string Blood_type = rdr["blood_type"] as string;
string dept_id = rdr["dept_id"] as string;
string[] emp_info = new string[] { Emp_id, Emp_name, Emp_email, Emp_tel, Emp_addr, Emp_emer_tel, Blood_type, dept_id };
dataGridView1.Rows.Add(emp_info);
}
}
conn.Close();
}
}
}
'데이터베이스 > Mysql' 카테고리의 다른 글
[Mysql] DB 생성 (0) | 2024.05.17 |
---|