 |
|
Dim MyCommand As New SqlClient.SqlCommand
MyCommand.Connection = myConnection
MyCommand.CommandText = "select OrderID,supplierID,supplierName,supplierOrder from Order INNER JOIN Supplier
ON Order .supplierID= Supplier .supplierID where OrderID= '%" & Text1.Text & "%' "
MyCommand.CommandType = CommandType.Text
Dim MyDA As New SqlClient.SqlDataAdapter
MyDA.SelectCommand = MyCommand
Dim myDS As New DataSet
MyDA.Fill(myDS, "MyCommand")
Rpt.SetDataSource(myDS)
Rpt.SetDatabaseLogon("sa", " ", "rx", "orderdb")
CrystalReportViewer1.ReportSource = Rpt
CrystalReportViewer1.RefreshReport()
ผลที่ได้ คือ ข้อมูลที่ได้ ไม่ได้เป็นตามเงื่อนไข where OrderID= '%" & Text1.Text & "%' จะให้ select ค่าตามเงื่อนไข ซึ่งรายงานที่แสดงออกมาออกมาหมดเลยครับ
Tag : .NET, Ms SQL Server 2005, Crystal Report, Web (ASP.NET), VB.NET
|
|
 |
 |
 |
 |
Date :
2011-09-15 21:37:09 |
By :
ken |
View :
1104 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |