'i am trying to get f_name + m_name + l_name three diferent columns combined from data grid view on cell content click into combobox.
Private Sub bugdgv_CellContentDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles bugdgv.CellContentDoubleClick
Dim row As Integer = bugdgv.CurrentCell.RowIndex
frmbug.bugcmbdeliver.Items.Clear()
Try
obcon.cmd.CommandText = "select d.del_name from deliver_project d,bug b where b.bug_id=d.del_id and d.del_name='" & bugdgv.Item("del_name", row).Value & "'"
obcon.con.Open()
Dim dr As SqlDataReader
dr = obcon.cmd.ExecuteReader
If (dr.Read) Then
frmbug.bugcmbdeliver.Items.Add(0)
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
obcon.con.Close()
End Try
frmbug.bugcmbassign.Items.Clear()
Try
'obcon.cmd.CommandText = "select c.f_name from deliver_project d,bug b where b.bug_id=d.del_id and d.del_name='" & bugdgv.Item("del_name", row).Value & "'"
obcon.cmd.CommandText = "select c.f_name + ' '+ c.l_name as 'name' from contact c,bug b where b.con_id=d.con_id and d.f_name + ' ' + d.l_name='" & bugdgv.Item("f_name + ' ' + l_name", row).Value
obcon.con.Open()
Dim dr As SqlDataReader
dr = obcon.cmd.ExecuteReader
If (dr.Read) Then
frmbug.bugcmbassign.Items.Add(0)
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
obcon.con.Close()
End Try
frmmain.BugsToolStripMenuItem_Click(sender, e)
frmbug.bugbtnedit.Show()
frmmain.bugs.bid = bugdgv.Item("bug_id", row).Value
frmmain.bugs.bugtxtname.Text = bugdgv.Item("bug_name", row).Value
frmmain.bugs.bugrtbdescription.Text = bugdgv.Item("bug_descrip", row).Value
frmmain.bugs.bugcmbdeliver.Text = bugdgv.Item("del_name", row).Value
'frmmain.bugs.bugcmbassign.Text = bugdgv.Item("f_name", row).Value
'frmmain.bugs.bugcmbassign.Text = bugdgv.Item("l_name", row).Value
frmmain.bugs.bugcmbstatus.Text = bugdgv.Item("bug_status", row).Value
frmmain.bugs.bugdtpdate.Text = bugdgv.Item("bug_date", row).Value
frmmain.bugs.bugtxtprojnm.Text = bugdgv.Item("bug_p_name", row).Value
frmmain.bugs.bugtxtwork.Text = bugdgv.Item("bug_name", row).Value
Me.Close()
end sub