473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

CR parameter2

8
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim conn As New SqlConnection("server=localhost; uid=sa; pwd=; database=pubs")
Dim da As New SqlDataAdapter("select distinct min_lvl from jobs", conn)
Dim da2 As New SqlDataAdapter("select distinct max_lvl from jobs", conn)
Dim ds As New DataSet
Dim ds2 As New DataSet

da.Fill(ds)
da2.Fill(ds2)

ComboBox1.DataSource = ds.Tables(0)
ComboBox1.DisplayMember = "min_lvl"
ComboBox1.ValueMember = "min_lvl"

ComboBox2.DataSource = ds2.Tables(0)
ComboBox2.DisplayMember = "max_lvl"
ComboBox2.ValueMember = "max_lvl"


End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


Dim container As New ParameterFields
Dim field1 As New ParameterField
Dim field2 As New ParameterField
Dim value1 As New ParameterDiscreteValue
Dim value2 As New ParameterDiscreteValue

field1.ParameterFieldName = "my_param1"
field2.ParameterFieldName = "my_param2"

value1.Value = ComboBox1.Text
value2.Value = ComboBox2.Text

field1.CurrentValues.Add(value1)
field2.CurrentValues.Add(value2)

container.Add(field1)
container.Add(field2)
' If value1.Value > value2.Value Then
' Msg'Box("Minimum level must be GREATER than the Maximum level")

' Else


Dim objR As New CrystalReport1
With CrystalReportViewer1
.ParameterFieldInfo = container
.ReportSource = objR
End With

' End If

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim container As New ParameterFields
Dim field1 As New ParameterField
' Dim field2 As New ParameterField
Dim value1 As New ParameterDiscreteValue
'Dim value2 As New ParameterDiscreteValue

field1.ParameterFieldName = "wad1"
'field2.ParameterFieldName = "my_param2"

value1.Value = TextBox1.Text
'value2.Value = ComboBox2.Text

field1.CurrentValues.Add(value1)
'field2.CurrentValues.Add(value2)

container.Add(field1)
' container.Add(field2)
' If value1.Value > value2.Value Then
' Msg'Box("Minimum level must be GREATER than the Maximum level")

' Else


Dim objR As New CrystalReport2
With CrystalReportViewer1
.ParameterFieldInfo = container
.ReportSource = objR
End With

' End If

End Sub
End Class
Jul 26 '06 #1
0 1167

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Simon Leonard | last post by:
I'm developing an API that I want be as user friendly as possible. My problem is that there are functions that can take many optional parameters (of various type) and I want to be able to specify...
1
by: Gerry Abbott | last post by:
Hi all I'm converting a db from Acc97 to 2000. Everything works, except assigning of a qdf object containing parameters, to a recordset. The db, recordset, and qrydef objects are all referenced...
3
by: Zlatko Matić | last post by:
Hello. I know how to call a parameterized stored procedure by using ADODB command object and parameters, but how can I execute the same query using adCmdText instead of adCmdStoredProc? Namely...
7
by: deko | last post by:
I have a function with a number of long loops. While the function is running, I want to be able to click a Stop button and exit the function as quickly as possible. The abbreviated code looks...
5
by: Roy Gourgi | last post by:
Hi, I just installed VS 2005 Express with SQL Server and when I try to run the code that was working with VS 2003 is no longer working. Is it not backward compatible. What has changed. Below is...
2
by: Leszek | last post by:
Hello! Can someone help me? How to get for some records (like 0 or 1) column names? Example: I've got a table, that looks server | parameter1 | parameter2 | parameter3...
6
by: Leszek | last post by:
I wrote an aspx page. It shows datagrid with values: server | parameter --------------------- server1 | parameter1 server1 | parameter2 server1 | parameter3 server1 | parameter4 server1...
0
by: Brian Tkatch | last post by:
Trying VB .NET. CREATE PROCEDURE A(A INTEGER, OUT B CHAR(1)) BEGIN SET B = 'C'; END In VB, opened a standard form, associated the .NET dll, in the code added Imports IBM.Data.DB2, and added...
3
by: Darko Bazulj | last post by:
Hi, txt file. list listname1@domain.tld parameter1 value parameter2 value parameter3 value list listname2@domain.tld parameter1 value
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.