hii all,
for selecting one item in a combo box n writing a search button_click code for that....
There are 3 items in teh combobox, nw for 1 item i want to write a code for search_button click
How to start with
If combobox = Project Manager Then................>> error
wat shd i consider...
plz someone help...
thnx
14 2444
hii all,
for selecting one item in a combo box n writing a search button_click code for that....
There are 3 items in teh combobox, nw for 1 item i want to write a code for search_button click
How to start with
If combobox = Project Manager Then................>> error
wat shd i consider...
plz someone help...
thnx
in Combobox
Could you explain more?What is your requirment?
hii all,
for selecting one item in a combo box n writing a search button_click code for that....
There are 3 items in teh combobox, nw for 1 item i want to write a code for search_button click
How to start with
If combobox = Project Manager Then................>> error
wat shd i consider...
plz someone help...
thnx
Do you mean that you want to call the same actions in the method button_click when option 1 is selected?
Which language are you using? e.g in C# :
to test the value selected on the combobox you use - if (this.combobox .Text == "Project Manager")
Do you mean that you want to call the same actions in the method button_click when option 1 is selected?
Which language are you using? e.g in C# :
to test the value selected on the combobox you use - if (this.combobox .Text == "Project Manager")
thnx for ur reply...
i have 3 items... i want to write in the search_button_click for 3rd option...
im using vb.net 1.1...
plz help..
in Combobox
Could you explain more?What is your requirment?
hii,
i have 2 comboboxes...one for select category(3items: project code, project location, project manager) and 2nd combobox for search list( where im populating the code, location and manager )
here im populating the records for code n location from tbl_projects (db) whereas for manager i need from tbl_staffs and tbl_staff_assignments(where category for manager is present)...
i hope u understand...
nw i have search button,
in this, i can search the records by project_id_pk...(tbl_projects)
[vb.net code] for search_button_click
' Get Primary Key from Listbox
objListItem = CType(cbPrSearchList.SelectedItem, ListItem)
cmSQL = New MySqlCommand
Dim mySelectQuery As String = "Select pr_project_id_pk, pr_project_code, pr_project_location, --etc " _
& "from tbl_projects where pr_project_id_pk= ?PrID"
cmSQL.Parameters.Add("?PrId", objListItem.ID)
[/code]
nw my doubt is i dont want to take list item, rather single ones...
how and wat shd be my code..???
plz help..
thnx n regards
hepsi..
hi friend,
i am not getting u.
give ur table details and combox and for what u r using the same and
what u need as ur output?
plz be clear
prabu
hii,
i have 2 comboboxes...one for select category(3items: project code, project location, project manager) and 2nd combobox for search list( where im populating the code, location and manager )
here im populating the records for code n location from tbl_projects (db) whereas for manager i need from tbl_staffs and tbl_staff_assignments(where category for manager is present)...
i hope u understand...
nw i have search button,
in this, i can search the records by project_id_pk...(tbl_projects)
[vb.net code] for search_button_click
' Get Primary Key from Listbox
objListItem = CType(cbPrSearchList.SelectedItem, ListItem)
cmSQL = New MySqlCommand
Dim mySelectQuery As String = "Select pr_project_id_pk, pr_project_code, pr_project_location, --etc " _
& "from tbl_projects where pr_project_id_pk= ?PrID"
cmSQL.Parameters.Add("?PrId", objListItem.ID)
[/code]
nw my doubt is i dont want to take list item, rather single ones...
how and wat shd be my code..???
plz help..
thnx n regards
hepsi..
hii,
i have 2 comboboxes...one for select category(3items: project code, project location, project manager) and 2nd combobox for search list( where im populating the code, location and manager )
here im populating the records for code n location from tbl_projects (db) whereas for manager i need from tbl_staffs and tbl_staff_assignments(where category for manager is present)...
i hope u understand...
nw i have search button,
in this, i can search the records by project_id_pk...(tbl_projects)
[vb.net code] for search_button_click
' Get Primary Key from Listbox
objListItem = CType(cbPrSearchList.SelectedItem, ListItem)
cmSQL = New MySqlCommand
Dim mySelectQuery As String = "Select pr_project_id_pk, pr_project_code, pr_project_location, --etc " _
& "from tbl_projects where pr_project_id_pk= ?PrID"
cmSQL.Parameters.Add("?PrId", objListItem.ID)
[/code]
nw my doubt is i dont want to take list item, rather single ones...
how and wat shd be my code..???
plz help..
thnx n regards
hepsi..
Still I couldnt get you
My understanding:
Combobox1 has following 3 items
1.ProjectCode
2.ProjectLocation
3.ProjectManager
Combobox 2 is empty
If you select ProjectManager in combobox1 all the projectmangers should be listed in Combobox2...
in button clickevent
if (this.combobox .selectedItem == "ProjectManager")
query="select distinct staffname from tbl_staff "
is this your requirment?
Still I couldnt get you
My understanding:
Combobox1 has following 3 items
1.ProjectCode
2.ProjectLocation
3.ProjectManager
Combobox 2 is empty
If you select ProjectManager in combobox1 all the projectmangers should be listed in Combobox2...
in button clickevent
if (this.combobox .selectedItem == "ProjectManager")
query="select distinct staffname from tbl_staff "
is this your requirment?
thnx for ur reply...
no thts not my requirement..
my requirement is:
combobox2 is not empty..
.combobox2:
1. abc
2.xyz
3.fdf;
so on. till 52
in the form i have a search button ...
when i select project manager from1st combobox, all the managers are populated in the 2nd combobox....(this is frm tbl_staffs)
nw when i click on search,
search is doin its operation in tbl_projects like
the list of managers tht r present in the combobox's primary key = tbl_projects primary key
that means it is not goin to tbl_staffs but rather tbl_projects
i hope u understand...
i need a help for writing a separate query for tbl_staffs for the project manager..
thnx
hepsi..
be clear my friend!
what u want to search?
what is table project contains?
give details about both table.
what result u r expecting?
thnx for ur reply...
no thts not my requirement..
my requirement is:
combobox2 is not empty..
.combobox2:
1. abc
2.xyz
3.fdf;
so on. till 52
in the form i have a search button ...
when i select project manager from1st combobox, all the managers are populated in the 2nd combobox....(this is frm tbl_staffs)
nw when i click on search,
search is doin its operation in tbl_projects like
the list of managers tht r present in the combobox's primary key = tbl_projects primary key
that means it is not goin to tbl_staffs but rather tbl_projects
i hope u understand...
i need a help for writing a separate query for tbl_staffs for the project manager..
thnx
hepsi..
thnx for ur reply...
no thts not my requirement..
my requirement is:
combobox2 is not empty..
.combobox2:
1. abc
2.xyz
3.fdf;
so on. till 52
in the form i have a search button ...
when i select project manager from1st combobox, all the managers are populated in the 2nd combobox....(this is frm tbl_staffs)
nw when i click on search,
search is doin its operation in tbl_projects like
the list of managers tht r present in the combobox's primary key = tbl_projects primary key
that means it is not goin to tbl_staffs but rather tbl_projects
i hope u understand...
i need a help for writing a separate query for tbl_staffs for the project manager..
thnx
hepsi..
You want to list the projectcode and projectlocation for the projectmanager you selected in the Combobox2.Is this right?
If yes,give your table_staff,table_staff_assignment,table_project structures(fields present in the table)
sample query:
select C.ID,C.ProjectCode,C.ProjectLocation,C.ProjectName from tbl_staff A
left join tbl_staff _assignments B on B.StaffID=A.ID
left join tbl_projects C on C.ID=B.projectID
where A.Name=(combobox.selecteditem)
You want to list the projectcode and projectlocation for the projectmanager you selected in the Combobox2.Is this right?
If yes,give your table_staff,table_staff_assignment,table_project structures(fields present in the table)
sample query:
select C.ID,C.ProjectCode,C.ProjectLocation,C.ProjectName from tbl_staff A
left join tbl_staff _assignments B on B.StaffID=A.ID
left join tbl_projects C on C.ID=B.projectID
where A.Name=(combobox.selecteditem)
thnq so much... i shall try tht code... n give u reply...
You want to list the projectcode and projectlocation for the projectmanager you selected in the Combobox2.Is this right?
If yes,give your table_staff,table_staff_assignment,table_project structures(fields present in the table)
sample query:
select C.ID,C.ProjectCode,C.ProjectLocation,C.ProjectName from tbl_staff A
left join tbl_staff _assignments B on B.StaffID=A.ID
left join tbl_projects C on C.ID=B.projectID
where A.Name=(combobox.selecteditem)
Hey ive tried it.... but of no use...
here is my code: -
' Get Primary Key from Listbox
-
objListItem = CType(cbPrSearchList.SelectedItem, ListItem)
-
-
cmSQL = New MySqlCommand
-
-
Dim mySelectQuery As String = "Select pr_project_id_pk, pr_project_code," _
-
& "pr_project_location, pr_project_manager_id_fk, pr_street_address, " _
-
& "pr_state_id_fk, pr_pincode, pr_postal_address, pr_phone, " _
-
& "pr_courier_service, pr_email, pr_om_field, pr_total_students, pr_total_staff, " _
-
& "pr_teaching_staff, pr_non_teaching_staff, pr_project_background, " _
-
& "pr_profile_status, pr_photo_status, pr_upload_status, pr_comm_history" _
-
& "from tbl_staffs INNER JOIN tbl_staff_assignments ON tbl_staff_assignments.sta_staff_id_fk = tbl_staffs.stf_staff_id_pk " _
-
& "INNER JOIN tbl_projects ON tbl_projects.pr_project_id_pk = tbl_staff_assignments.sta_project_id_fk " _
-
& "WHERE tbl_staff_assignments.sta_project_id_fk = ?StId"
-
-
-
cmSQL.Parameters.Add("?StId", objListItem.ID)
-
-
cnSQL = New MySqlConnection
-
cnSQL.ConnectionString = connect.ConnectionString
-
-
cmSQL.Connection = cnSQL
-
cmSQL.CommandText = mySelectQuery
-
-
Its takingdirectly the project_id from tbl_projects not from tbl_staff_assignments project_id...
plz if u can help me...
Hey ive tried it.... but of no use...
here is my code: -
' Get Primary Key from Listbox
-
objListItem = CType(cbPrSearchList.SelectedItem, ListItem)
-
-
cmSQL = New MySqlCommand
-
-
Dim mySelectQuery As String = "Select pr_project_id_pk, pr_project_code," _
-
& "pr_project_location, pr_project_manager_id_fk, pr_street_address, " _
-
& "pr_state_id_fk, pr_pincode, pr_postal_address, pr_phone, " _
-
& "pr_courier_service, pr_email, pr_om_field, pr_total_students, pr_total_staff, " _
-
& "pr_teaching_staff, pr_non_teaching_staff, pr_project_background, " _
-
& "pr_profile_status, pr_photo_status, pr_upload_status, pr_comm_history" _
-
& "from tbl_staffs INNER JOIN tbl_staff_assignments ON tbl_staff_assignments.sta_staff_id_fk = tbl_staffs.stf_staff_id_pk " _
-
& "INNER JOIN tbl_projects ON tbl_projects.pr_project_id_pk = tbl_staff_assignments.sta_project_id_fk " _
-
& "WHERE tbl_staff_assignments.sta_project_id_fk = ?StId"
-
-
-
cmSQL.Parameters.Add("?StId", objListItem.ID)
-
-
cnSQL = New MySqlConnection
-
cnSQL.ConnectionString = connect.ConnectionString
-
-
cmSQL.Connection = cnSQL
-
cmSQL.CommandText = mySelectQuery
-
-
Its takingdirectly the project_id from tbl_projects not from tbl_staff_assignments project_id...
plz if u can help me...
Im getting this error
Dim mySelectQuery As String = "Select pr_project_id_pk, pr_project_code," _
& "pr_project_location, pr_project_manager_id_fk, pr_street_address, " _
& "pr_state_id_fk, pr_pincode, pr_postal_address, pr_phone, " _
& "pr_courier_service, pr_email, pr_om_field, pr_total_students, pr_total_staff, " _
& "pr_teaching_staff, pr_non_teaching_staff, pr_project_background, " _
& "pr_profile_status, pr_photo_status, pr_upload_status, pr_comm_history, " _
& "pr_cs_comments, pr_lkg, pr_ukg, pr_class01, pr_class02, pr_class03, " _
& "pr_class04, pr_class05, pr_class06, pr_class07, pr_class08, pr_class09, " _
& "pr_class10, pr_year_started , pr_land_status, pr_building_status, " _
& "pr_ann_op_cost, pr_project_remarks, pr_info_date, pr_isactive " _
& "FROM tbl_staffs LEFT JOIN tbl_staff_assignments ON tbl_staff_assignments.sta_staff_id_fk = tbl_staffs.stf_staff_id_pk " _
& "LEFT JOIN tbl_projects ON tbl_projects.pr_project_id_pk = tbl_staff_assignments.sta_project_id_fk " _
& "WHERE tbl_staffs.stf_first_name = ?SID "
cmSQL.Parameters.Add("?SID", objListItem.ID)
General Error
Cast from string "" to type 'Double' is not valid.
Im getting this error
Dim mySelectQuery As String = "Select pr_project_id_pk, pr_project_code," _
& "pr_project_location, pr_project_manager_id_fk, pr_street_address, " _
& "pr_state_id_fk, pr_pincode, pr_postal_address, pr_phone, " _
& "pr_courier_service, pr_email, pr_om_field, pr_total_students, pr_total_staff, " _
& "pr_teaching_staff, pr_non_teaching_staff, pr_project_background, " _
& "pr_profile_status, pr_photo_status, pr_upload_status, pr_comm_history, " _
& "pr_cs_comments, pr_lkg, pr_ukg, pr_class01, pr_class02, pr_class03, " _
& "pr_class04, pr_class05, pr_class06, pr_class07, pr_class08, pr_class09, " _
& "pr_class10, pr_year_started , pr_land_status, pr_building_status, " _
& "pr_ann_op_cost, pr_project_remarks, pr_info_date, pr_isactive " _
& "FROM tbl_staffs LEFT JOIN tbl_staff_assignments ON tbl_staff_assignments.sta_staff_id_fk = tbl_staffs.stf_staff_id_pk " _
& "LEFT JOIN tbl_projects ON tbl_projects.pr_project_id_pk = tbl_staff_assignments.sta_project_id_fk " _
& "WHERE tbl_staffs.stf_first_name = ?SID "
cmSQL.Parameters.Add("?SID", objListItem.ID)
General Error
Cast from string "" to type 'Double' is not valid.
& "WHERE tbl_staffs.stf_first_name = ?SID "
cmSQL.Parameters.Add("?SID", objListItem.ID)
what the objectlistItem.ID contains?either staffname or ID
If you connecting with ID
use
& "WHERE tbl_staffs.ID= ?SID "
& "WHERE tbl_staffs.stf_first_name = ?SID "
cmSQL.Parameters.Add("?SID", objListItem.ID)
what the objectlistItem.ID contains?either staffname or ID
If you connecting with ID
use
& "WHERE tbl_staffs.ID= ?SID "
hey thnq so much... its workin nw...
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Donna Sabol |
last post by:
I have a form (frm_MAIN_RPT) that contains a combo box (Combo6) &
subform (dbo_REQ_subform). The combo box is used to select the "cost
center" data that will be displayed in the subform. From...
|
by: ree |
last post by:
I have two combo boxes on a dialog window.
The aim is to check the the strings of the items. But if no items are
selected then this line crashes the program.
if...
|
by: Stephen Miller |
last post by:
When I dynamically populate a HtmlSelect combo box, the Value property
consistently fails to return the item selected, defaulting instead to
the first item in the list. For example:
Protected...
|
by: jimb |
last post by:
I can get the dropdownlist into the datagrid, and I can populate it, but I
can't read it.
Anybody have a working example of a dropdownlist in an editable grid?
Thanks.
--
.....
|
by: Brian Henry |
last post by:
say I have a databound combo box, which allows for text entry still
(DropDownStype = DropDown in this case).
now, If the user doesn't enter manually an item in the data bound list,
nothing...
|
by: Smokey Grindle |
last post by:
Say I have a combo box with the following simple object
Public class MyObject
public ID as integer
public Name as string
public overrides sub ToString() as string
return name
end sub
end...
|
by: Ranjan kumar Barik |
last post by:
Hello !!!
I am Ranjan.
can the selected item of a combo box be displayed on the same page.
I mean when I just click the item of a combo box it will atonce displayed on the page.
Thanks !!!
|
by: Just_a_fan |
last post by:
In VB6, I could easily take the value from a combo box and make a
command with it, this: baudrate = cboBaud(listindex).
With the new dotted stuff in VB9, I can't seem to do that. Here's an...
|
by: ZaphodBBB |
last post by:
Hi
I have a form frmAdd_Equipment. It has a number of combo boxes on it, cboModel, cboSupplier, cboManufacturer, cboEquipment_Type etc.
Bcause therer is no existing data to go off I put an ADD...
|
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,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
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...
| |