c#水晶报表连接mysql_水晶报表同ACCESS数据库连接问题

非常感谢 阿泰 版主的回复。

我按照您的方法做了,但是我不是用的 web方式

用的 winform 方式。

我想是一样的。

但是 我做了以后 过滤出来的数据显示不出来啊。不知道是哪里出了错。

第一个 winform 上我一个 textbox 定义name 为 BianH 一个 botton 当 botton click的时候 运行

private void button1_Click(object sender, EventArgs e)

{

string BianH = this.BianH.Text;

Form ShowBianH = new ShowBianH(BianH );

ShowBianH .ShowDialog();

}

第二 个 winform 上 我添加了一个 crystalReportViewer1

代码这样写的。

public partial class ShowBianH : Form

{

public ShowBianH(string BianH)

{

string a = BianH;

InitializeComponent();

label1.Text = a;

}

private void ShowBianH_Load(object sender, EventArgs e)

{

string b = label1.Text;

DataSet1 ds1 = new DataSet1();

OleDbDataAdapter da = new OleDbDataAdapter();

string conStr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e_record.mdb";//;Data Source=path; Jet OLEDB:Database Password=pwd;//

OleDbConnection con = new OleDbConnection(conStr);

da = new OleDbDataAdapter("SELECT RegName as RegName,IdType as IdType,BianH as BianH,LandNum as LandNum From AppUser", con);

da.Fill(ds1, "AppUser");

//da = new OleDbDataAdapter("select BianH as BianH,AddDate as AddDate From Land_Case where BianH=" + "'" + b + "'" + "", con);

//da.Fill(ds1, "Land_Case");

//da = new OleDbDataAdapter("select LandNum as LandNum,LandAddress as LandAddress From TLand where BianH=" + "'" + b + "'" + "", con);

//da.Fill(ds1, "TLand");

//da = new OleDbDataAdapter("select Csyj as Csyj From Shyj where BianH=" + "'" + b + "'" + "", con);

//da.Fill(ds1, "Shyj");

ReportDocument myReport = new ReportDocument();

//string reportPath = System.Web.HttpContext.Current.Server.MapPath("bin/debug/CrystalReport1.rpt");

//myReport.Load(reportPath);

myReport.SetDataSource(ds1);

crystalReportViewer1.ReportSource = myReport;

}

}

运行的时候 具体数据不显示出来。。不知道什么原因啊。?

作者: jiefy

发布时间: 2010-12-16

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值