问题描述
来编写where子句或条件
现在我使用这些步骤创建的日子>>
第一次创建数据集使用TableAdapter(在图片1中显示)
第二个DataSet附加Crystal报告
此代码在Vb.net中使用按钮
Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System .EventArgs)处理Button1.Click
Dim rpt as testformularpt = new testformularpt
Dim ds as testformuladataset = new testformuladataset
Dim adp as testformuladatasetTableAdapters。 DCMasterTableAdapter =新testformuladatasetTableAdapters.DCMasterTableAdapter
adp.Fill(ds.DCMaster)
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
CrystalReportViewer1.SelectionFormula()={DcMaster.DCNo} in [''&修剪(txttest.Text)& '',''&修剪(Txttest1.Text)& '']
End Sub
但我不能wrtie手动Sql查询
我只是在这里编写Sql查询select * from emp where date& textbox1& and& textbox2&
我应该在这里改变什么在这里写Sql查询
图像1和2这里
http://postimg.org/image/ro5qm2puf/[^]
http://postimg.org/image/4nz39qs0n/[^]
now a days i create with these step >>
1st Create Dataset use TableAdapter (show in image1)
2nd DataSet Attach With Crystal Report
3rd this Code use in Vb.net of Button
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim rpt As testformularpt = New testformularpt
Dim ds As testformuladataset = New testformuladataset
Dim adp As testformuladatasetTableAdapters.DCMasterTableAdapter = New testformuladatasetTableAdapters.DCMasterTableAdapter
adp.Fill(ds.DCMaster)
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
CrystalReportViewer1.SelectionFormula() = "{DcMaster.DCNo}in [''" & Trim(txttest.Text) & "'' ,''" & Trim(Txttest1.Text) & "''] "
End Sub
But i Cant wrtie Manual Sql Query
Just I Write Sql Query herelike this "select * from emp where Date between &textbox1& and &textbox2&
What Should i Change here to Write Sql Query here
image 1 and 2 here
http://postimg.org/image/ro5qm2puf/[^]
http://postimg.org/image/4nz39qs0n/[^]
推荐答案
这篇关于如何在使用Vb.net和VS 2005的CryStal报告中使用Sql查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!