473,395 Members | 1,677 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,395 software developers and data experts.

Setting Parameters for CR

TS
Hi all,
From my windows form I connected to a SQL database and had two cbo boxes
generating clients last and first names from the SQL database. I also created
a CR report pulling data from the same database and included it in my
project. What I want to do is the following:-

1- I want the cbo box that holds the first name of the client to return the
clients first names based on the last name selected from the last name cbo
box.
2- I want to have another lst box in my form showing the client IDs (it will
show more than one client ID if more than one client has the same last and
first name)based on the last name and first name selected.
3-I want the user when selecting a client ID from the lst box and hit on a
button to generate the CR for that particular client.

The codes I wrote so far to connect to the SQL database and generate the two
cbo boxes are the following. I am having difficulties to move forward to
accomplish what I need, please help!!

Private Sub ConnectSQL_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ConnectSQL.Click
Dim SQLEV As SqlClient.SqlConnection = New SqlClient.SqlConnection()
Dim cmd As SqlClient.SqlCommand
Dim ClientName As SqlClient.SqlDataReader

SQLEV.ConnectionString = "Persist Security Info=true;Integrated
Security=false;User ID=sa;Password=xxxx;database=yyyy;server=zzzz"
SQLEV.Open()
cmd = New SqlClient.SqlCommand("SELECT * FROM qmf_cint", SQLEV)

ClientName = cmd.ExecuteReader
cbo_ChildLName.Items.Clear()
cbo_ChildFName.Items.Clear()
Do While ClientName.Read

cbo_ChildLName.Items.Add(Trim(ClientName.Item("Las t_Name").ToString))

cbo_ChildFName.Items.Add(Trim(ClientName.Item("Fir st_Name").ToString))
Loop
SQLEV.Close()

End Sub


--
TS
Nov 21 '05 #1
0 999

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rhino | last post by:
I am working with SQL Functions in DB2 for Windows/Linux/UNIX (V8.2.1) and am having a problem setting input parameters for SQL Functions to null in the Development Center. My simple function,...
2
by: Chris | last post by:
Hi, I'm new to ASP.Net and Crystal but I've been playing with some samples and have run into a problem. If I put all my code into the Page_Init sub of a single form and run that form, the...
4
by: Patrick Olurotimi Ige | last post by:
I have a DropDown Lsit set to ddlGetDebtor.Items.Insert(0, "-Select Debtor Code-") which is setting the "-Select Debtor Code-" to be default And on PostBack i'm passng:- Cmd.Parameters.Add(New...
3
by: Nobody | last post by:
Hi -- I'm developing an ASP.NET application in VS.NET and I want the startup page to read in some parameters from a querystring. But I can't figure out where to set the querystring. I thought it...
1
by: Niggy | last post by:
When setting parameters, I get the error: System.IndexOutOfRangeException: Invalid index -1 With Me.MySqlCommand1 .Parameters("@FileName").Value = sFileName .ExecuteNonQuery() End With
8
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
11
by: Alexander Walker | last post by:
Hello I would like to write a method that allows me to pass a reference to an instance of a class, the name of a property of that class and a value to set that property to, the method would then...
0
by: Greg Pyle | last post by:
I have created a parameter query (qryAuthors) that reads three parameters from three different fields on a subform (Subform1). Each time the form record changes, the query updates automatically. ...
2
by: StuckProgrammer | last post by:
Hi, I have 10 queries linked together via an incident number. There is a form where the user enters start and end dates to define which incident numbers are used within the queries. On running...
5
by: dana1 | last post by:
Hello Experts! Does anyone know if there is a way to set the values of query parameters from VBA for a report's recordsource? (i.e., I want to set the values of the parameters and NOT have the...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.