CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #3
    Join Date
    Jul 2009
    Location
    Kuwait
    Posts
    170

    Re: databinding in adodb connection

    I modified te code to
    Code:
        rst.Open("SELECT lp.ITEM, lp.ORD, INVENT." & qt1 & ", INVENT." & qt2 & ", INVENT." & qt3 & ", INVENT." & qt4 & ", INVENT." & qt5 & ", INVENT." & qt6 & ", INVENT." & qt7 & ", INVENT." & qt8 & ", INVENT." & qt9 & ", " & totquan & ", lp.PRICE, lp.CATEGORY, lp.LINE, lp.QORD FROM INVENT INNER JOIN lp ON INVENT.ITEM_NO = lp.ITEM_NO Where lp.ITEM Like '" & itemno & "' ORDER BY lp.ITEM", fcn)
            BindingSource1.DataSource = rst
    
                       rst1.Open("SELECT lp.ITEM as totitem, lp.ORD, INVENT." & qt1 & ", INVENT." & qt2 & ", INVENT." & qt3 & ", INVENT." & qt4 & ", INVENT." & qt5 & ", INVENT." & qt6 & ", INVENT." & qt7 & ", INVENT." & qt8 & ", INVENT." & qt9 & ", " & totquan & ", lp.PRICE, lp.CATEGORY, lp.LINE, lp.QORD FROM INVENT INNER JOIN lp ON INVENT.ITEM_NO = lp.ITEM_NO Where lp.ITEM Like '" & itemno & "' ORDER BY totitem", fcn)
    
                    While Not rst.EOF 
                        If IsDBNull(rst1(11).Value) = False And IsDBNull(rst1(15).Value) = False And Val(rst1(15).Value) <> 0 Then
                                                 ts = (rst1(15).Value) - (rst1(11).Value)
                   
                            ts = ts * 100
                            DataGridView1.Item(17, s).Value = Format((ts / Val(rst1(15).Value))) ', "0.00")
                        Else
                            DataGridView1.Item(17, s).Value = "No T/O"
                        End If
                        s = s + 1
                        If s > DataGridView1.RowCount Then
                            Exit While
                        End If
                        rst1.MoveNext()
                    End While
    rst1.close()
          rst.Close()
    I am getting multiple exceptions
    I have attached a screen shot of the errors
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured