//OLEDB를 이용 한 예제 입니다.
//Visual Studio .Net에서 C#, 윈도우 프로그래을 선택한 후 실행해 보세요
//결과는 화면에 윈도우가 나타 나면서 그안에 EMP Table의 내용이 나오는 겁니다.
using System.Data.OleDb; //for OleDbConnection, OleDbCommand , etc
using System.Data; //for DataSet
using System.Windows.Forms; //DataGrid, Form
using System; //for String
class GridForm : Form
{
private DataGrid dataGrid1 ;
public GridForm()
{
AutoScaleBaseSize = new System.Drawing.Size(6, 14);
ClientSize = new System.Drawing.Size(544, 342);
Load += new System.EventHandler(this.Form1_Load);
dataGrid1 = new DataGrid();
dataGrid1.Name = "dataGrid1";
dataGrid1.Size = new System.Drawing.Size(520, 312);
Controls.Add(this.dataGrid1);
}
OleDbConnection Conn;
OleDbCommand myCommand;
DataSet myDataSet;
OleDbDataAdapter myAdapter;
private void Form1_Load(object sender, System.EventArgs e)
{
try
{
//-------------------------------------------------------------------------------
//아래는 오라클용 접속 문자열, wink는 net service 이름
//-------------------------------------------------------------------------------
string ConStr = ("Provider=MSDAORA;data source=wink;User ID=scott;Password=tiger");
Conn = new OleDbConnection(ConStr);
Conn.Open();
String sql = "select * from emp ";
myCommand = new OleDbCommand(sql, Conn);
myAdapter = new OleDbDataAdapter();
myCommand.CommandType = CommandType.Text ;
myAdapter.SelectCommand = myCommand;
myDataSet = new DataSet();
myAdapter.Fill(myDataSet, "emp");
dataGrid1.DataSource = myDataSet;
dataGrid1.DataMember = "emp";
}
catch(Exception ex)
{
MessageBox.Show(ex.Message, "emp Table Loading");
}
finally
{
Conn.Close();
}
}
}
class Displayform
{
static void Main()
{
System.Windows.Forms.Application.Run(new GridForm());
}
}
//Visual Studio .Net에서 C#, 윈도우 프로그래을 선택한 후 실행해 보세요
//결과는 화면에 윈도우가 나타 나면서 그안에 EMP Table의 내용이 나오는 겁니다.
using System.Data.OleDb; //for OleDbConnection, OleDbCommand , etc
using System.Data; //for DataSet
using System.Windows.Forms; //DataGrid, Form
using System; //for String
class GridForm : Form
{
private DataGrid dataGrid1 ;
public GridForm()
{
AutoScaleBaseSize = new System.Drawing.Size(6, 14);
ClientSize = new System.Drawing.Size(544, 342);
Load += new System.EventHandler(this.Form1_Load);
dataGrid1 = new DataGrid();
dataGrid1.Name = "dataGrid1";
dataGrid1.Size = new System.Drawing.Size(520, 312);
Controls.Add(this.dataGrid1);
}
OleDbConnection Conn;
OleDbCommand myCommand;
DataSet myDataSet;
OleDbDataAdapter myAdapter;
private void Form1_Load(object sender, System.EventArgs e)
{
try
{
//-------------------------------------------------------------------------------
//아래는 오라클용 접속 문자열, wink는 net service 이름
//-------------------------------------------------------------------------------
string ConStr = ("Provider=MSDAORA;data source=wink;User ID=scott;Password=tiger");
Conn = new OleDbConnection(ConStr);
Conn.Open();
String sql = "select * from emp ";
myCommand = new OleDbCommand(sql, Conn);
myAdapter = new OleDbDataAdapter();
myCommand.CommandType = CommandType.Text ;
myAdapter.SelectCommand = myCommand;
myDataSet = new DataSet();
myAdapter.Fill(myDataSet, "emp");
dataGrid1.DataSource = myDataSet;
dataGrid1.DataMember = "emp";
}
catch(Exception ex)
{
MessageBox.Show(ex.Message, "emp Table Loading");
}
finally
{
Conn.Close();
}
}
}
class Displayform
{
static void Main()
{
System.Windows.Forms.Application.Run(new GridForm());
}
}
오라클자바커뮤니티교육센터, 개발자전문교육, 개인80%환급
www.oraclejavacommunity.com
평일주간(9:30~18:10) 개강
(6/23)[기업100%환급]자바기초에서 JDBC, Servlet/JSP까지
(6/23)[기업100%환급]Spring ,MyBatis,Hibernate실무과정
(6/23)[기업100%환급]SQL기초에서 Schema Object까지
(6/30)[기업100%환급]PL/SQL,ORACLE HINT,TUNING
(6/30)[기업100%환급]안드로이드개발자과정
(7/07)[기업100%환급]C#4.0,WinForm,ADO.NET프로그래밍
(7/07)[채용예정교육]오라클자바개발잘하는신입뽑기프로젝트,교육전취업확정
평일야간(19:00~21:50) 개강
(6/17)자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis까지
(6/18)C#,ASP.NET마스터
(6/19)웹퍼블리싱 마스터
(6/19)Spring3.X, MyBatis, Hibernate실무과정
(6/24)안드로이드개발자과정
(6/24)MyBatis3.X, Hibernate4.X ORM실무과정
(6/26)SQL초보에서실전전문가까지
(7/02)자바웹(JSP,Spring,MyBatis,XPlatform)프로젝트과정
주말(10:00~17:50) 개강
(6/21)Spring3.X, MyBatis, Hibernate실무과정
(6/21)MyBatis3.X, Hibernate4.X ORM실무과정
(6/21)자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis까지
(6/28)SQL초보에서 Schema Object까지
(6/28)안드로이드개발자과정
(6/28)개발자를위한PLSQL,SQL튜닝,힌트
(6/28)실무예제로 배워보는 jQuery(개발자/디자이너를위한)
(6/28)자바웹(JSP,Spring,MyBatis,XPlatform)프로젝트과정
(7/13)C#,ASP.NET마스터
주말저녁(18:30~22:20) 개강
(6/28)JAVA,Network&WEB&Framework
(6/28)SQL기초에서실무까지
www.oraclejavacommunity.com
평일주간(9:30~18:10) 개강
(6/23)[기업100%환급]자바기초에서 JDBC, Servlet/JSP까지
(6/23)[기업100%환급]Spring ,MyBatis,Hibernate실무과정
(6/23)[기업100%환급]SQL기초에서 Schema Object까지
(6/30)[기업100%환급]PL/SQL,ORACLE HINT,TUNING
(6/30)[기업100%환급]안드로이드개발자과정
(7/07)[기업100%환급]C#4.0,WinForm,ADO.NET프로그래밍
(7/07)[채용예정교육]오라클자바개발잘하는신입뽑기프로젝트,교육전취업확정
평일야간(19:00~21:50) 개강
(6/17)자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis까지
(6/18)C#,ASP.NET마스터
(6/19)웹퍼블리싱 마스터
(6/19)Spring3.X, MyBatis, Hibernate실무과정
(6/24)안드로이드개발자과정
(6/24)MyBatis3.X, Hibernate4.X ORM실무과정
(6/26)SQL초보에서실전전문가까지
(7/02)자바웹(JSP,Spring,MyBatis,XPlatform)프로젝트과정
주말(10:00~17:50) 개강
(6/21)Spring3.X, MyBatis, Hibernate실무과정
(6/21)MyBatis3.X, Hibernate4.X ORM실무과정
(6/21)자바기초에서JSP,Ajax,jQuery,Spring3.2,MyBatis까지
(6/28)SQL초보에서 Schema Object까지
(6/28)안드로이드개발자과정
(6/28)개발자를위한PLSQL,SQL튜닝,힌트
(6/28)실무예제로 배워보는 jQuery(개발자/디자이너를위한)
(6/28)자바웹(JSP,Spring,MyBatis,XPlatform)프로젝트과정
(7/13)C#,ASP.NET마스터
주말저녁(18:30~22:20) 개강
(6/28)JAVA,Network&WEB&Framework
(6/28)SQL기초에서실무까지
댓글 없음:
댓글 쓰기