Click here to Skip to main content
15,895,557 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Pass selected row in Datagrid view to another datagrid on another form Pin
εїзεїзεїз8-Sep-09 6:13
εїзεїзεїз8-Sep-09 6:13 
QuestionAccess Is Denied while checking process terminated or not. Pin
Gagan.207-Sep-09 7:15
Gagan.207-Sep-09 7:15 
AnswerRe: Access Is Denied while checking process terminated or not. Pin
Luc Pattyn7-Sep-09 8:09
sitebuilderLuc Pattyn7-Sep-09 8:09 
GeneralRe: Access Is Denied while checking process terminated or not. Pin
Gagan.207-Sep-09 16:48
Gagan.207-Sep-09 16:48 
GeneralRe: Access Is Denied while checking process terminated or not. Pin
Luc Pattyn8-Sep-09 0:38
sitebuilderLuc Pattyn8-Sep-09 0:38 
GeneralRe: Access Is Denied while checking process terminated or not. Pin
Gagan.208-Sep-09 0:46
Gagan.208-Sep-09 0:46 
GeneralRe: Access Is Denied while checking process terminated or not. Pin
Luc Pattyn8-Sep-09 1:05
sitebuilderLuc Pattyn8-Sep-09 1:05 
QuestionDisplay one value in combobox, but use another. Pin
Nielvh7-Sep-09 2:00
Nielvh7-Sep-09 2:00 
I have a table populated with details of people (Name, tel, address, etc.) Each record has a unique key. I want to fill a combobox with the names, but when a user clicks on the name I want to use the unique identifier to get the corresponding detail. Below is my code to fill the combobox. How should I change this so that the combobox also knows what the unique identifier is?
I am new to programming, so any other comments on my code would also be appreciated.
Thanks for any help.
Private Sub GetContactNames()
        Dim SqlContactname As String _
                    = "SELECT _rtblPeople.idPeople, _rtblPeople.cDisplayName " _
                    & "FROM _rtblPeople, _rtblPeopleLinks " _
                    & "WHERE _rtblPeopleLinks.iDebtorID = @customercode " _
                    & "AND _rtblPeopleLinks.cModule = 'AR' " _
                    & "AND _rtblPeople.idPeople = _rtblPeopleLinks.iPeopleID"

        Dim Sqlparam As SqlClient.SqlParameter
        Sqlparam = New SqlClient.SqlParameter("@customercode", SqlDbType.Int)
        Sqlparam.Value = My.Settings.CustomerCode

        Using conn As New SqlConnection(CntString)
            Try
                conn.Open()
                Dim MyCommand As New SqlCommand(SqlContactname, conn)
                MyCommand.Parameters.Add(Sqlparam)
                Dim datareader As SqlDataReader
                datareader = MyCommand.ExecuteReader
                While datareader.Read()
                    ContactNameField.Items.Add(datareader.Item("cDisplayName"))
                End While
                datareader.Close()
                conn.Close()
            Catch myerror As SqlException
                MessageBox.Show("Error Connecting to Database: " & myerror.Message)
                conn.Dispose()
            End Try
        End Using
    End Sub

AnswerRe: Display one value in combobox, but use another. Pin
Luc Pattyn7-Sep-09 2:44
sitebuilderLuc Pattyn7-Sep-09 2:44 
GeneralRe: Display one value in combobox, but use another. Pin
Nielvh7-Sep-09 23:21
Nielvh7-Sep-09 23:21 
GeneralRe: Display one value in combobox, but use another. Pin
Johan Hakkesteegt7-Sep-09 23:40
Johan Hakkesteegt7-Sep-09 23:40 
GeneralRe: Display one value in combobox, but use another. Pin
Nielvh8-Sep-09 0:01
Nielvh8-Sep-09 0:01 
GeneralRe: Display one value in combobox, but use another. Pin
Johan Hakkesteegt8-Sep-09 0:11
Johan Hakkesteegt8-Sep-09 0:11 
GeneralRe: Display one value in combobox, but use another. Pin
Nielvh8-Sep-09 0:21
Nielvh8-Sep-09 0:21 
GeneralRe: Display one value in combobox, but use another. Pin
Johan Hakkesteegt8-Sep-09 0:26
Johan Hakkesteegt8-Sep-09 0:26 
GeneralRe: Display one value in combobox, but use another. Pin
Nielvh8-Sep-09 0:37
Nielvh8-Sep-09 0:37 
QuestionThe Remote Server Returned an error :(411) Length Required Pin
dcdhingra6-Sep-09 20:49
dcdhingra6-Sep-09 20:49 
AnswerRe: The Remote Server Returned an error :(411) Length Required Pin
Hurricane30007-Sep-09 11:07
Hurricane30007-Sep-09 11:07 
GeneralRe: The Remote Server Returned an error :(411) Length Required Pin
dcdhingra8-Sep-09 4:17
dcdhingra8-Sep-09 4:17 
QuestionMore efficient way to program row visibility in VB Pin
Cardary6-Sep-09 20:35
Cardary6-Sep-09 20:35 
AnswerRe: More efficient way to program row visibility in VB Pin
Christian Graus6-Sep-09 21:35
protectorChristian Graus6-Sep-09 21:35 
AnswerRe: More efficient way to program row visibility in VB Pin
εїзεїзεїз6-Sep-09 22:00
εїзεїзεїз6-Sep-09 22:00 
AnswerRe: More efficient way to program row visibility in VB Pin
N a v a n e e t h6-Sep-09 22:33
N a v a n e e t h6-Sep-09 22:33 
Questiontelephone number word generator Pin
rbjanaki6-Sep-09 11:12
rbjanaki6-Sep-09 11:12 
AnswerRe: telephone number word generator Pin
Henry Minute6-Sep-09 11:39
Henry Minute6-Sep-09 11:39 

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.