Click here to Skip to main content
15,910,471 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: remove buttons for lists Pin
Dave Kreskowiak14-Apr-06 1:32
mveDave Kreskowiak14-Apr-06 1:32 
QuestionStructure Array Pointers Pin
Ed Hunt ,Jr.12-Apr-06 14:40
Ed Hunt ,Jr.12-Apr-06 14:40 
AnswerRe: Structure Array Pointers Pin
Dave Kreskowiak12-Apr-06 15:28
mveDave Kreskowiak12-Apr-06 15:28 
Questionconfiguration file Pin
SVb.net12-Apr-06 11:38
SVb.net12-Apr-06 11:38 
AnswerRe: configuration file Pin
Dave Kreskowiak12-Apr-06 15:23
mveDave Kreskowiak12-Apr-06 15:23 
AnswerRe: configuration file Pin
nguyenvhn12-Apr-06 23:03
nguyenvhn12-Apr-06 23:03 
GeneralRe: configuration file Pin
Dave Kreskowiak13-Apr-06 2:26
mveDave Kreskowiak13-Apr-06 2:26 
QuestionHelp needed with multi column Combobox? Pin
Rashar12-Apr-06 9:39
Rashar12-Apr-06 9:39 
Hi,

I have filled a dataset with my customers ok, but I am running in to some problems when trying to create a multi coloumn combobox with the data set.

When I run the code below, I receive the message "Object reference not set to an instance of an object" at this for loop....

For Each drDSRow In ds.Tables("tblCustomer").Rows:

When I look into my CustomerDataset, I can see my table, and indeed it is called tblCustomer.

Here is what I am trying to accomplish:

'Retrieve the data into a DataSet:
Me.TblCustomerTableAdapter.Fill(Me.CustomerDataset.tblCustomer)

Dim drDSRow As DataRow
Dim drNewRow As DataRow
Dim ds As New DataSet
'Create and populate the DataTable to bind to the ComboBox:
Dim dt As New CustomerDataset.tblCustomerDataTable
dt.Columns.Add("Cust Name", GetType(System.String))
dt.Columns.Add("Cust Number", GetType(System.String))

'populate Datatable
For Each drDSRow In ds.Tables("tblCustomer").Rows
drNewRow = dt.NewRow
drNewRow("Cust Name") = drDSRow("Cust_Name")
drNewRow("Cust Number") = drDSRow("Cust_Number1")
dt.Rows.Add(drNewRow)
Next

'bind datatable to the combobox by setting the combobox's datasource property to the datatable.

Me.cboDealerSelector.DropDownStyle = ComboBoxStyle.DropDownList

With Me.cboDealerSelector
.DataSource = dt
.DisplayMember = "Cust_Name"
.ValueMember = "Cust_Number1"
'.SelectedIndex = 0
End With

Dim aIndex As Integer

With Me.cboDealerSelector
For aIndex = 0 To .Items.Count - 1
If CType(.Items(aIndex)(1), String).Trim = TextBox2.Text.Trim Then
.SelectedIndex = aIndex
Exit For
End If
Next

If aIndex >= .Items.Count Then .SelectedIndex = -1
End With


Any suggestions is greatly appreciated.

Thanks,

Rashar

-- modified at 15:41 Wednesday 12th April, 2006
AnswerRe: Help needed with multi column Combobox? Pin
Dave Kreskowiak12-Apr-06 15:17
mveDave Kreskowiak12-Apr-06 15:17 
Questionhow to highlight only the selected text in a List view Items and sub items? Pin
Ruki7612-Apr-06 8:35
Ruki7612-Apr-06 8:35 
AnswerRe: how to highlight only the selected text in a List view Items and sub items? Pin
Dave Kreskowiak12-Apr-06 17:18
mveDave Kreskowiak12-Apr-06 17:18 
QuestionRe: how to highlight only the selected text in a List view Items and sub items? Pin
Ruki7613-Apr-06 0:39
Ruki7613-Apr-06 0:39 
AnswerRe: how to highlight only the selected text in a List view Items and sub items? Pin
Dave Kreskowiak13-Apr-06 2:25
mveDave Kreskowiak13-Apr-06 2:25 
Questionhow to highlight only the selected text in a List view Items and sub items? Pin
Ruki7612-Apr-06 8:34
Ruki7612-Apr-06 8:34 
Questionmasked textbox for webform Pin
seekerOfSeekers12-Apr-06 8:04
seekerOfSeekers12-Apr-06 8:04 
QuestionCursor Image Pin
Peter B12-Apr-06 6:16
Peter B12-Apr-06 6:16 
AnswerRe: Cursor Image Pin
Dave Kreskowiak12-Apr-06 15:07
mveDave Kreskowiak12-Apr-06 15:07 
GeneralRe: Cursor Image Pin
Peter B13-Apr-06 2:13
Peter B13-Apr-06 2:13 
GeneralRe: Cursor Image Pin
Dave Kreskowiak13-Apr-06 2:24
mveDave Kreskowiak13-Apr-06 2:24 
QuestionProblens using shell for ICQ in VB Pin
misabe12-Apr-06 6:14
misabe12-Apr-06 6:14 
AnswerRe: Problens using shell for ICQ in VB Pin
Dave Kreskowiak12-Apr-06 15:00
mveDave Kreskowiak12-Apr-06 15:00 
QuestionMonitoting File System Pin
alexfromto12-Apr-06 5:28
alexfromto12-Apr-06 5:28 
AnswerRe: Monitoting File System Pin
Dave Kreskowiak12-Apr-06 5:58
mveDave Kreskowiak12-Apr-06 5:58 
GeneralRe: Monitoting File System Pin
alexfromto12-Apr-06 6:10
alexfromto12-Apr-06 6:10 
QuestionI have make a extention .XYZ opened by my application ... Pin
cylix200012-Apr-06 4:43
cylix200012-Apr-06 4:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.