파이썬 & 오픈소스 개발 질문과 답변 게시판
제 피씨에서 프로그램을 완성한 후 설치 프로그램을 만들고.
다른피씨에서 프로그램을 설치하고 실행했더니 dataGridView와 Chart 가 있는 form 에서 다음과 같은 에러 메시지가 떴습니다.
DataSet에서는 OLEDB를 사용하여 테이블과 쿼리를 작성했습니다.
[ODBC 드라이버 관리자] 데이터 원본 이름이 없고 기본 드라이버를 지정하지 않았습니다
어떻게하면 되나요?
프로그램...
==========================================================================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsApplication1
{
public partial class Form11 : Form
{
private string ConStr = @"server=192.168.0.10;uid=sa;pwd=1234*;database=test";
Form2 form2;
public Form11(Form2 form2)
{
InitializeComponent();
SqlConnection conn = new SqlConnection(ConStr);
this.form2 = form2;
try
}
private void Form11_Load(object sender, EventArgs e)
{
// TODO: 이 코드는 데이터를 'dataSet1.item_group_qty_amt_sec' 테이블에 로드합니다. 필요한 경우 이 코드를 이동하거나 제거할 수 있습니다.
this.item_group_qty_amt_secTableAdapter.Fill(this.dataSet1.item_group_qty_amt_sec);
string MAX = this.dataSet1.item_group_qty_amt_sec.Count.ToString();
string[] strptr;
int[] intplan_qty;
int[] intsale_qty;
//, j;
strptr = new string[Convert.ToInt64(MAX)];
intplan_qty = new int[Convert.ToInt64(MAX)];
intsale_qty = new int[Convert.ToInt64(MAX)];
SqlConnection conn = new SqlConnection(ConStr);
try
{
conn.Open();
string stSql = "SELECT item_group_nm AS 제품군, CONVERT(int,Q01) AS 계획수량,CONVERT(int,LA01) AS 계획금액,CONVERT(int,Q02) AS 매출량,CONVERT(int,LA02) AS 매출금액 ,CONVERT(int,Q02-Q01) 차이수량,CONVERT(int,LA02-LA01) 차이금액 FROM dbo.s_plan_sale_qty_amt WHERE (BP_LINE_CD = '01') AND (Q01 <> 0) OR (BP_LINE_CD = '01') AND (LA01 <> 0) OR (BP_LINE_CD = '01') AND (Q02 <> 0) OR (BP_LINE_CD = '01') AND (LA02 <> 0)";
SqlCommand Comm = new SqlCommand(stSql, conn);
SqlDataReader read = Comm.ExecuteReader();
int w = 0;
if (read != null)
{
while (read.Read())
{
strptr[w] = read["제품군"].ToString();
intplan_qty[w] = Convert.ToInt32(read["계획수량"].ToString());
intsale_qty[w] = Convert.ToInt32(read["매출량"].ToString());
w = w + 1;
}
}
read.Close();
conn.Close();
}
catch
{
Console.WriteLine("데이터베이스 연결오류");
}
finally
{
if (conn != null)
{
conn.Close();
}
}
for (int i = 1; i <= Convert.ToInt32(MAX); i++)
{
chart1.Series[1].Points.DataBindXY(strptr, intplan_qty);
chart1.Series[0].Points.DataBindXY(strptr, intsale_qty);
}
}
}
}
==========================================================================================================
Comment 1
-
미르83
2011.10.21 12:52
OLEDB에 test DB(192.168.0.10)를 추가를 안해서 그랬네요.ㅋㅋ
그런데 꼭 클라이언트에서 OLEDB를 설정해줘야 하나요?
설정을 안해주고 프로그램으로 성정 하는 방법은 없을까요?