تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[سؤال] باراميتر و LISTBOX
#13
الحمد لله تم التوصل الى الحل ، وسأضع الاجابة حتى يستفيد منها من واجهته تلك المشكلة
If IsPostBack Then
Dim ds As New DataSet
Dim cmd As New SqlCommand
Dim con As New SqlConnection("Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\ClaimDB.mdf;Integrated Security=True")
Try
con.Open()
Dim sql, sql1, sql2 As String

sql = "select * from GHTable "

sql1 = " where GHDate between convert(date,'" & txtFrom.Text & "',103) and convert(date,'" & txtTo.Text & "',103) "
If ListBox2.Items.Count > 0 Then
For i = 0 To ListBox2.Items.Count - 1
If sql2 = "" Then
sql2 = sql2 + "and GHSort=N'" & ListBox2.Items(i).Value.ToString & "' "
Else
sql2 = sql2 + "or GHSort=N'" & ListBox2.Items(i).Value.ToString & "' "
End If
Next
End If
sql = sql + sql1 + sql2
cmd.CommandText = sql
cmd.Connection = con
cmd.CommandType = CommandType.Text

Dim da As New SqlDataAdapter(cmd)
da.Fill(ds)

con.Close()
ReportViewer1.LocalReport.ReportPath = "Reports/ReportGH1.rdlc"
Dim rds As New Microsoft.Reporting.WebForms.ReportDataSource("DataSet1", ds.Tables(0))
ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(rds)

ReportViewer1.LocalReport.Refresh()
Catch ex As Exception
Label1.Text = "جاري صيانة الموقع"
End Try
End If
الرد }}}
تم الشكر بواسطة: العزابي


الردود في هذا الموضوع
باراميتر و LISTBOX - بواسطة fefooo29 - 17-12-15, 05:54 PM
RE: باراميتر و LISTBOX - بواسطة fefooo29 - 24-12-15, 11:51 AM
RE: باراميتر و LISTBOX - بواسطة k_medhat - 29-04-16, 07:25 PM
RE: باراميتر و LISTBOX - بواسطة Compiler - 30-04-16, 07:34 AM
RE: باراميتر و LISTBOX - بواسطة k_medhat - 01-05-16, 09:18 AM
RE: باراميتر و LISTBOX - بواسطة k_medhat - 02-05-16, 11:22 AM
RE: باراميتر و LISTBOX - بواسطة Compiler - 06-05-16, 12:55 AM
RE: باراميتر و LISTBOX - بواسطة سعود - 06-05-16, 06:02 AM
RE: باراميتر و LISTBOX - بواسطة k_medhat - 10-05-16, 05:00 PM
RE: باراميتر و LISTBOX - بواسطة k_medhat - 21-05-16, 07:30 PM
RE: باراميتر و LISTBOX - بواسطة khodor1985 - 21-05-16, 08:11 PM
RE: باراميتر و LISTBOX - بواسطة ابو ليلى - 21-05-16, 09:10 PM
RE: باراميتر و LISTBOX - بواسطة k_medhat - 23-05-16, 07:21 PM

التنقل السريع :


يقوم بقرائة الموضوع: