|
In your sub
jalandoonk wrote: Private Sub PopulateCountry()
you are only adding the items to the combo box but not selecting any
jalandoonk wrote: Do While contryList.Read
objCountry = contryList(0)
cbxCCountry.Items.Add(objCountry)
cbxCountry.Items.Add(objCountry)
Loop
when you are doing a call from from load you are trying to get the selected item
jalandoonk wrote: Dim country As String
country = cbxCCountry.SelectedValue
You first have to select one item then only you can get selected item
You can do this by any of the tho methods
cbxCCountry.Text ="" 'Put the item string which you want to select
Or
cbxCCountry.selectedindex = 1 'The index number of item you want to select
Good luck
Nishkarsh
|
|
|
|
|
just solved it. my code works i just got mixed up with the ".SelectedItem" and ".SelectedValue"
|
|
|
|
|
Hello sir, setting the combo box border as i saw flat combo topic
how to change the border according to my requirement.
Pls suggest me
regards
|
|
|
|
|
Look through the properties of a combo box in the designer. If you can't do it there, I guess it was owner drawn.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You can Create your own Combo box using Textbox,List box with a New Property.
Cheers
Anubhav Dimri
anubhava@prodata.gmail.com
9250168195
|
|
|
|
|
Hi pls suggest me by giving sample example
|
|
|
|
|
He's saying you can build one from scratch as a custom control. He can't possibly paste the code for that here, nor is it likely he has it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Create a Project for User Control.
Insert a Text box. for Combo text.and then Use List for Combobox items.
insert a button for Indexchange of List.
Then u can create your own Combo box.
Cheers
Anubhava Dimri
919250168195
|
|
|
|
|
I've this VB .NET Windows application that uses MS Access.
I am converting it to use SQL Server as backend.
What I've done so far (in the .vb and in the .resx) files: 1. modified the connection strings.
2. Changed the OleDbParameters to add "@" at the beginning of the parameter name like ...new OleDbParameters("@StartDate",....)
3. Added "@" at the beginning of the Adapter's command parameters like: UpdateEventTypeAdapter.UpdateCommand.Parameters("@EventTypeID").Value = .....
I basically work with web applications, so I don't exactly know/remember whether I should change anything else. For example - the DataSet xsd files. I haven't touched them at all. I am getting Object Reference not set to an instance...error from one of the DataSets.
Any idea what I am missing?
Thanks.
Ekjon
|
|
|
|
|
How do you get an exception from a dataset - it's null ? If so, check carefully the code that creates it and what it calls, etc. You are probably swallowing an exception higher up. You could also try moving to the SQL Server specific classes instead of the OleDB ones.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am writing a software program. When I tried to add a student and then check the student drop down box the student added successfuly, but when I try to add a lesson the lesson does not add. I added a message box to see if the info was adding to the dataRow for the database Update and the info showed up in the messageBox.
When I check the lesson listView the lesson is not there.
How do I find out if the lesson is adding to the database?
I am using SQL Server Express 2005 and the Copy to output directory is set to copy always.
Here is my code.
Public addRow As DataRow
MsgBox(txtInstrument.Text & "," & Convert.ToInt32(cboSelectStudent.SelectedValue) & "," & Convert.ToDateTime(dtpStartDate.Text) & "," & Convert.ToDateTime(dtpEndDate.Text) & "," & Convert.ToDateTime(lvwItem.SubItems(1).Text) & "," & intDay & "," & Convert.ToInt32(cboSelectTeacher.SelectedValue) & "," & intLessStat)
addRow = lpDataSet.tbl_lessons.Newtbl_lessonsRow()
addRow("less_instrument") = txtInstrument.Text
addRow("stud_id") = Convert.ToInt32(cboSelectStudent.SelectedValue)
If dtpStartDate.Visible = True Then
addRow("less_start_date") = Convert.ToDateTime(dtpStartDate.Text)
End If
If dtpEndDate.Visible = True Then
addRow("less_end_date") = Convert.ToDateTime(dtpEndDate.Text)
End If
If lvwChooseTimeslot.Visible = True Then
addRow("less_time") = Convert.ToDateTime(lvwItem.SubItems(1).Text)
addRow("less_day") = intDay
addRow("teach_id") = Convert.ToInt32(cboSelectTeacher.SelectedValue)
End If
addRow("less_status") = intLessStat
lpDataSet.tbl_lessons.Rows.Add(addRow)
lessonTableAdapter.Update(addRow)
|
|
|
|
|
You select from the database again and see if your record is there. I would write actual database code to do the update, then I wouldn't have any questions that it worked.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
>When I check the lesson listView the lesson is not there.
Is the listview control bound? If it's not then it won't automatically pick
up the changes in the db.
>How do I find out if the lesson is adding to the database?
One way is in VS, in your Data Sources window, right click the
table name and click "Preview Data".
|
|
|
|
|
I know how to control multiple click functions with a single button:
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click, button2.click but I have a different kind of problem. I have, say, three buttons: Button1, Button2 and Button3. Each has a textbox associated with it: TextBox1, TextBox2 and TextBox3. I have some code for each one that is exactly the same, save for the textbox it controls, simplified below:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = "Test"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = "Test"
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.Text = "Test"
End Sub
Is there a way to make this into a single subroutine, or am I stuck creating a fourth subroutine, and passing all the values to it?
|
|
|
|
|
you can do this by checking the name or tag of the button that did the clicking ( it's passed in as sender, you just need to cast it to be a button ), then perform your action based on which button you find it was.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
elaborating on Christian's reply, you can figure out which button got pressed by
casting sender to a Button (say myButton); and when you have assigned each TextBox to
its corresponding Button's Tag (a Tag is a freely available reference), you can
simply cast myButton.Tag to myTextBox and operate on it.
|
|
|
|
|
Do you know how to make a control array?
I guess that would help you resolve your problem.
|
|
|
|
|
|
Sorry, I posted to the wrong forum...
I, try to move it to the C# forum...
|
|
|
|
|
Hiii Experts
I am Working on Outlook 2003 and my problem is i want to get the handle of word mail editor. in outlook our mail editor type is ms word and i want to get the handle of this document not the application. how can i get this.
Plz Help
Thanx
Mitesh Khatri
|
|
|
|
|
Hi,
I need to reduce the flickering on listview when change the backcolor of subitems of each and every item in listview continously(for eg : 5 times per second).
Thanks,
Latha
Latha.P
Raja Engg College,
Madurai.
|
|
|
|
|
Try listview1.suspendlayout before making the changes and listview1.resumelayout afterwards
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Sorry, I have already used that, but still flickering.
Latha.P
Raja Engg College,
Madurai.
|
|
|
|
|
Sorry, out of ideas then.
Bob
Ashfield Consultants Ltd
|
|
|
|
|