VS 2008 Populate Combo Box With File Names?
Jun 16, 2009I want the files names in a specific folder to show in a combox box. How can I accomplish this?
View 1 RepliesI want the files names in a specific folder to show in a combox box. How can I accomplish this?
View 1 RepliesI need to populate a Combo Box with sheet names in an Excel File. I Have an openfiledialog that i search for the excel file and put the dirPath to a textbox, now i need to populate the ComboBox with the sheets in that file, the idea is so when i select sheet3 in the ComboBox, i can pass that sheet name to the string for processing.
View 4 Repliesbasically, i'm creating a program that is saving text files based on user input.
another screen is then needing to transfer the saved information into textboxes.
to do this i want the saved .txt files' titles to shows in a listbox, and when each selection is made, the textboxes are populated with the information in the .txt files.
I'm trying to populate a List Box or Combo Box (either or, I feel like both would be very similar in how the code is written) when you load the form. Here is what I have right now:
<a href="http://s2.photobucket.com/albums/y11/funkyfries222/?action=view¤t=ForumHelp.png" target="_blank"><img src="http://i2.photobucket.com/albums/y11/funkyfries222/ForumHelp.png" border="0" alt="Photobucket"></a>
When you first open the program it gives you a form with either a list box or combo box (not sure which one I want to use yet) and then an add button to add a name to the list. It shows the from where you enter a name and then when you add a name it adds it to a text file that I have saved onto the desktop. It keeps the names on separate lines and I want each line in the text file to be an item in a list box...
Here is the code for the first form:
Public Class frmEmployeesMeat
Private Sub frmEmployeesMeat_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
frmHours.Visible = False
[code]....
i have a combobox and richtextbox, text box. in my rich textbox i have a
Smart BRO 15,SMBRO15
Smart BRO 30,SMBRO30
Smart BRO 50,SMBRO50
Smart BRO 60,SMBRO60
Smart BRO 100,SMBRO100
Smart BRO 115,SMBRO115
i want to split this in to two. i want to load the this in my combobox
ex.
Smart BRO 15
Smart BRO 30
Smart BRO 50
when i select Smart Bro 15 in combobox, the SMBRO15 will show in textbox .
Currently, i have a simple application that manages the user account on a machine. The functionality includes the adding, deleting and modifying of user account. For deleting a user account, the username has to be entered into a text box. But i want a combo box to be created and named of the user account that are already created on the machine
View 4 RepliesI am getting an error when i try to populate some combo boxes with a value, the combo box has values in and the right amount the code is getting the right number.
the error msg is "Object reference not set to an instance of an object."
I want to populate my combobox with the list of banknames available in my database.. I tried doing so but I am getting a blank list. i.e.. shows no value in combobox!
Here is what I tried...
Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged
Try
'MsgBox("Open")
cn = New OleDbConnection("Provider=microsoft.jet.oledb.4.0;Data Source=E:\Project-Hemtech\HemDatabase1.mdb;")
[Code] .....
I use the following code to populate a ComboBox with printer names.
Dim ps As PrinterSettings.StringCollection = PrinterSettings.InstalledPrinters
For i As Integer = 0 To ps.Count - 1
Me.CurrentPrinter.Items.Add(ps.Item(i))
Next
When the uses selects a printer from the ComboBox I then need to set a PrintDialog.PrintQueue to the PrintQueue that corresponds to the select name (which is a string). Here's the code I tried that's not working.
Dim dlg As New PrintDialog()
dlg.PrintQueue = GetPrintQueueFromCombo()
dlg.PrintVisual(canvas, "AlignPrinterSampleForm")
[Code].....
I have been trying for days to populate a combobox with user names from our LDAP. I can not seem to get this to work however I am really new to LDAP also. Here is my code...
[Code]...
I have tested the code for the DataSet and DataAdaptor and both work fine, and as test was able to place the MaxRows variable into one of the text boxes on my form so I know thats all ok. But I am now trying to use the function below to copy the 1st cell of each row into a combo box to populate the options and comes up with a null exception error but cant get my head around it.
[Code]...
I'm trying to populate a combo box with some data from a xml document, but so far all i'm getting is this error message in the combo box[code]...
View 2 RepliesI am new to Visual Basic and I'm trying to make a simple combo box that automatically populates from dataset. The table is from BaseMaterial with the column Material.
View 5 RepliesI have a form with one combo box and text box and buttons. please refer the snapshot with i have attached.I have the following code:
My Stored Procedure for inserting the data:
/*
Name: usp_InsertBranchSetup
[code]......
I'm trying to populate a combo box with a dataset, this sort of works, but everything is just appearing on the same line. I think this answer might be to put the dataset into an array, then put the array into the combo box.
...problem is, I'm not sure how to do this! My code thus far is,
Dim usernameList As Array
'Retrieve usernames where player has available status
GetFilteredData()
[Code].....
I am currently stuck in one part of my application. I have two combo boxes that i am having the users select from. The first combo box is simply bound to a datatable. that is working properly. The second one i need to populate off another datatable after sorting out what the first one is requesting. Basically it's choosing a line number on the first box and then selecting the machine associated with that line number.[code]...
View 4 Repliescan someone please give me basic steps on how to hard code a combo box to display a column from a database?
View 21 RepliesI want to fill data in my combo box using Add range method.
cboFirst.Items.Add("Sunday")
cboFirst.Items.Add("Monday")
cboFirst.Items.Add("Tuesday")
[Code]....
This is how im filling my combo with days. i want to do the Same but by using Add Range Method.
Im trying to pooulate a combo box in vb.net 2008 with information from my access database, but I have no idea how to do thi :S im trying to get it so that the customer names from the database appear in the combo box this is as far as i've gotten for my form load.[code]
View 4 RepliesI am currently writing a program that needs the use of a database. At the moment I am trying to get a simple combobox working.The problem I am having is that I have never done any work with databases and VB08.I am using an access database that has the fields SMTP, Port, SSL
I want to populate a combo box with the field SMTP and from there I want 2 other labels to be filled in with the port and ssl details I was wondering a) How do I set the connection up with Visual Basic (within the database I am using MySQL to get the information) b) How do I go about populating the combo box?
How to populate a combo box using SQL Data Reader in DAL, BAL and UI atmosphere. Please find below my code snippets and correct me if I'm wrong anywhere in this code.
'DAL Code
Public Function PopulateComboBox() As SqlDataReader
_cnCon = New SqlConnection(_conString)
_cnCon.Open()
[Code]....
What should be the UI code? Is the code specified in DAL and BAL is correct? I knoiw how to fill the combo box with values from SQL Data Reader. But I dont know how this can be done in 3 Tier application.
Is there a way to populate a combox with a list of available drive letters? I've tried the following code but could not gt it to wrok.
[Code]...
So I feel like im pretty close, but I also have a feeling I am mixing up StreamReader and ReadAllLines[code]...
View 1 RepliesI am using these codes to populate a Combo o a Listview. What i want is to populate de List or a Combo depending a selected value.
cn = New SqlConnection(stringdeconexion)
cn.Open()
Dim sql As String
[Code].....
I have the following bit of code which works find but I have been asked to show for the displayvalue the storecode - storename. How can I do this?
sSQL = "SELECT * FROM ST_STORES WHERE ST_RG_CODE = '" & cboRegion.SelectedValue & "' ORDER BY ST_STORENAME"
sqlDSStoresCombo = rppData.tblGetTableData(sSQL, "ST_STORES")
[Code].....
I think I manually need to add the items but don't know how to add an item that has a value and display.
Is it possible to fill a Combo Box with the names of the fields of a table(from a database)?
View 6 RepliesI'm trying to make a database program in VB 2008 and have come across a problem with a query that I'm not sure how to solve. I have a combo box which contains names of teams that are held within the database, when a team name is selected I have 4 queries that will separate players (in that team) by their position, using this information I will then be able to display information about the players in a collection objects so that it can be edited and what not.
My problem is that I need to be able to refer to the records in the query so that I can assign a players details to objects on the form, I've used a piece of code to do so that I used previously to select individual records from a table, however when I click on a team in the combo box it throws up the error: "Could not format node 'ClientQuery' for execution as SQL.". Not being a particularly experienced VB programmer this error doesn't exactly mean too much to me, although I am not exactly sure of another way to tackle the problem.
The code for this query is:
Dim GK(3, 2) As String
Dim c As Integer = 0
For Each Record In GoalkeeperQuery
[CODE]...
All the fields in the query are strings. If this is not enough information I can post the query I used to select the records in the query used above or anything else that's related.
I made project using VB.Net 2005 with multi languages, the first form is MDIParent form with MainMenu and toolbars also there is some changes in properties as righttoleft and text of forms.In my Mainmenu (Menustrip) there is opetion to change the UI Culture and I have already done but I need to change all texts in the form as mainmenu items anf form properties.My quetion is: how can I reload my form again to read the new texts names and mainmenu items names from resx file?
View 8 RepliesI am a developing an application based on VB 2008 express and a MYSQL database.I have created a database called octupus_db and inside it there is a table called customers.I now have a combo box on my form and i want it to populate its contents from field called town inside the customers table. How do do this? [code]but now connection a table and a field with my application is the next night mare, tried .
View 2 RepliesHow to take a value from a combo box and have it update a field in sql table?
View 1 Replies