problem in binding dataset to report
Posted: Mon Mar 15, 2010 1:09 am
Hello
Here is my code in vb.net 2008
this code execute correctly but the query dose not filter the result. such as time you don't bind any dataset to the report and just load and show it. the names of connection and datasource in report are the same as dataset and dataset.table in the program. what is the problem?
Here is my code in vb.net 2008
Code: Select all
Imports Stimulsoft.Report
Imports System.Data.SqlClient
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ds As New DataSet
Dim con As SqlConnection
Dim com As SqlCommand
Dim da As SqlDataAdapter
con = New SqlConnection(Class_Connection_String.Connection_String)
com = New SqlCommand()
com.Connection = con
da = New SqlDataAdapter
com.CommandText = "SELECT * FROM [View_Operator's_Operation] WHERE (([کد کاربر] = " + TextBox1.Text + ") AND ([نام عملکرد] = '" + ComboBox1.Text + "'))"
da.SelectCommand = com
Try
ds.Clear()
da.Fill(ds)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
ds.DataSetName = "stimul_con"
ds.Tables(0).TableName = "stimul_ds"
Dim rtp As New StiReport()
rtp.Load("E:\Create Dinamic Report With StimulReports\Sample\Report00.mrt")
rtp.RegData(ds)
rtp.Dictionary.Synchronize()
rtp.Show()
End Sub
End Class