Click here to Skip to main content
15,899,313 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Bitwise AND in an If/Else block Pin
Richard MacCutchan8-May-13 20:56
mveRichard MacCutchan8-May-13 20:56 
GeneralRe: Bitwise AND in an If/Else block Pin
treddie8-May-13 22:14
treddie8-May-13 22:14 
AnswerRe: Bitwise AND in an If/Else block Pin
Richard MacCutchan9-May-13 1:07
mveRichard MacCutchan9-May-13 1:07 
GeneralRe: Bitwise AND in an If/Else block Pin
treddie10-May-13 16:14
treddie10-May-13 16:14 
GeneralRe: Bitwise AND in an If/Else block Pin
Richard MacCutchan8-May-13 2:53
mveRichard MacCutchan8-May-13 2:53 
AnswerRe: Bitwise AND in an If/Else block Pin
TnTinMn8-May-13 3:24
TnTinMn8-May-13 3:24 
GeneralRe: Bitwise AND in an If/Else block Pin
treddie8-May-13 22:15
treddie8-May-13 22:15 
Questioncascading comboboxes vb.net windows forms Pin
Agontuk6-May-13 8:39
Agontuk6-May-13 8:39 
I am new in VB.Net programing. please help me to solve this problem.

VB
Private Sub frmRX_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'dt = New DataTable()
        'MakeDataTable()
        'Load Generic Name
        Dim Gename As String = "SELECT GName, GID FROM GenericName ORDER BY GName"
        Dim cmdGname As New SqlCommand(Gename, con)
        Dim daGname As New SqlDataAdapter(cmdGname)
        daGname.SelectCommand.CommandText = cmdGname.CommandText.ToString()
        Dim dtGname As New DataTable()
        daGname.Fill(dtGname)
        ddlGname.DataSource = dtGname
        ddlGname.DisplayMember = "GName"
        ddlGname.ValueMember = "GID"

        'Autocomplete combo
        ddlGname.AutoCompleteMode = AutoCompleteMode.SuggestAppend
        ddlGname.AutoCompleteSource = AutoCompleteSource.ListItems
    End Sub

VB
Private Sub ddlGname_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlGname.SelectedIndexChanged



       'Dim GnameValue = ddlGname.SelectedValue.ToString()

       Dim ComName As String = "SELECT ComID,ComName FROM View_MedicineInfo WHERE GID = '" & ddlGname.SelectedValue.ToString() & "'  GROUP BY ComID, ComName"
       Dim cmdComName As New SqlCommand(ComName, con)
       Dim daComName As New SqlDataAdapter(cmdComName)
       'daComName.SelectCommand.CommandText = cmdComName.CommandText.ToString()
       Dim dsComName As New DataSet()
       daComName.Fill(dsComName)
       ddlComName.DisplayMember = "ComName"
       ddlComName.ValueMember = "ComID"
       ddlComName.DataSource = dsComName


But here
daComName.Fill(dsComName)
I got this error

Conversion failed when converting the varchar value 'System.Data.DataRowView' to data type int.

i have observed that if i put direct value like '1579' instead of & ddlGname.SelectedValue.ToString() & , it works fine
AnswerRe: cascading comboboxes vb.net windows forms Pin
NotPolitcallyCorrect6-May-13 10:15
NotPolitcallyCorrect6-May-13 10:15 
GeneralRe: cascading comboboxes vb.net windows forms Pin
Agontuk7-May-13 0:42
Agontuk7-May-13 0:42 
AnswerRe: cascading comboboxes vb.net windows forms Pin
Simon_Whale7-May-13 1:30
Simon_Whale7-May-13 1:30 
AnswerRe: cascading comboboxes vb.net windows forms Pin
Dave Kreskowiak7-May-13 1:44
mveDave Kreskowiak7-May-13 1:44 
GeneralRe: cascading comboboxes vb.net windows forms Pin
Agontuk9-May-13 8:53
Agontuk9-May-13 8:53 
QuestionHow to export the data from datagridview & all the data on the form1.vb make a report Pin
chandan H T5-May-13 1:24
chandan H T5-May-13 1:24 
AnswerRe: How to export the data from datagridview & all the data on the form1.vb make a report Pin
Eddy Vluggen5-May-13 8:49
professionalEddy Vluggen5-May-13 8:49 
QuestionTreeView Find not working Pin
treddie4-May-13 22:17
treddie4-May-13 22:17 
AnswerRe: TreeView Find not working Pin
Eddy Vluggen5-May-13 8:45
professionalEddy Vluggen5-May-13 8:45 
GeneralRe: TreeView Find not working Pin
treddie5-May-13 9:44
treddie5-May-13 9:44 
GeneralRe: TreeView Find not working Pin
Eddy Vluggen5-May-13 10:06
professionalEddy Vluggen5-May-13 10:06 
GeneralRe: TreeView Find not working Pin
treddie5-May-13 14:51
treddie5-May-13 14:51 
GeneralRe: TreeView Find not working Pin
JR2125-May-13 20:55
JR2125-May-13 20:55 
GeneralRe: TreeView Find not working Pin
treddie5-May-13 23:02
treddie5-May-13 23:02 
AnswerRe: TreeView Find not working Pin
Eddy Vluggen6-May-13 7:45
professionalEddy Vluggen6-May-13 7:45 
GeneralRe: TreeView Find not working Pin
treddie6-May-13 11:02
treddie6-May-13 11:02 
GeneralRe: TreeView Find not working Pin
Eddy Vluggen7-May-13 0:33
professionalEddy Vluggen7-May-13 0:33 

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.