Click here to Skip to main content
16,010,544 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: BandObject Help Pin
Member 165616028-Jan-05 7:15
Member 165616028-Jan-05 7:15 
GeneralRe: BandObject Help Pin
Dave Kreskowiak31-Jan-05 1:23
mveDave Kreskowiak31-Jan-05 1:23 
GeneralDropDown Selection Box Pin
DuckPlucker28-Jan-05 3:43
DuckPlucker28-Jan-05 3:43 
GeneralRe: DropDown Selection Box Pin
Dave Kreskowiak28-Jan-05 6:25
mveDave Kreskowiak28-Jan-05 6:25 
GeneralCalling VB DLLs from C Pin
Rusty7828-Jan-05 3:08
Rusty7828-Jan-05 3:08 
GeneralRe: Calling VB DLLs from C Pin
rwestgraham30-Jan-05 17:41
rwestgraham30-Jan-05 17:41 
QuestionHow to pass parameter to VC function like this? Pin
rushing27-Jan-05 23:55
rushing27-Jan-05 23:55 
Generalfilling a DataTable Pin
lxhan27-Jan-05 18:51
lxhan27-Jan-05 18:51 
I have a VB.Net windows app that retrieves data from 3 different tables. The SQL command uses a 3 table join. The results from the query is filled into a datatable and later populated into a combobox.


The SQL uses the values from a date field inside a text field, for example, 01-15-2005. So, each time I submit the subroutine it executes the SQL command and VB.Net code to retrieve the required data. The date field changes according to the user’s needs.


There’s no consistency when the error pops up.
The error message I’m getting when it executes, da.Fill(dataTable), “There’s no row at position 0”,. The information I’m on the stack track is as follow: Calling SQLDisconnect --- OleDB UnInitialize not called!!!
Connection Object destroyed


If I copy the sql into a sql query tool it does retrieve the required data according to the date field.


Here’s a sample of the subroutine:



cmdQueryINVOICE = _
"SELECT PAYITEM.TRANSACT_NUMBER, " _
& "PAYITEM.ACCOUNT_NUMBER, " _
& "PAYITEM.PAY_DATE, " _
& "LSEINVH.INVOICE_NUMBER " _
& "FROM LSEINVH, PAYITEM, TRANSHDR " _
& "WHERE " _
& " LSEINVH.INVOICE_NUMBER > '" & 75000 _
& "' AND LSEINVH.STATUS <> '" & sStatus _
& "' AND LSEINVH.INVOICE_NUMBER = TRANSHDR.INVOICE_NUMBER " _
& " AND PAYITEM.PAY_DATE > '" & InvoiceDates.StartDate _
& "' AND PAYITEM.PAY_DATE < '" & InvoiceDates.EndDate _
& "' AND PAYITEM.COMPANY = '" & sCompany _
& "' AND PAYITEM.TRANSACT_NUMBER = TRANSHDR.TRANS_NUMBER order by PAYITEM.PAY_DATE desc "



Dim sqlQuery As OleDbCommand = connDf.CreateCommand
Dim dtInvDate As New DataTable()
Dim iInvCnt, x As Integer
Dim sUnitQuery As String
Dim daInv As New OleDbDataAdapter()

Try

daInv = New OleDbDataAdapter(cmdQueryINVOICE, connDf)
daInv.Fill(dtInvDate)


Dim LoopRow As Data.DataRow
Dim test As String = dtInvDate.Rows.Item(0).ToString

For Each LoopRow In dtInvDate.Rows
cboInvoice.Items.Add(LoopRow.Item("INVOICE_NUMBER").ToString + " " + LoopRow.Item("PAY_DATE"))
Next

Catch e As Exception
Dim errMsg As String = e.Message

Finally
connDf.Close()

End Try


Thanks, any help would be grateful.
GeneralRe: filling a DataTable Pin
The Man from U.N.C.L.E.27-Jan-05 23:15
The Man from U.N.C.L.E.27-Jan-05 23:15 
GeneralRe: filling a DataTable Pin
lxhan1-Feb-05 3:37
lxhan1-Feb-05 3:37 
GeneralRe: filling a DataTable Pin
mtone28-Jan-05 3:11
mtone28-Jan-05 3:11 
GeneralRe: filling a DataTable Pin
lxhan1-Feb-05 3:42
lxhan1-Feb-05 3:42 
GeneralBandObject Help Pin
Member 165616027-Jan-05 12:13
Member 165616027-Jan-05 12:13 
GeneralRe: BandObject Help Pin
Dave Kreskowiak28-Jan-05 3:42
mveDave Kreskowiak28-Jan-05 3:42 
Generalcreate word application in vb.net Pin
Member 162996427-Jan-05 11:02
Member 162996427-Jan-05 11:02 
GeneralSuppressing Save as Dialog box Pin
Anonymous27-Jan-05 10:58
Anonymous27-Jan-05 10:58 
Generalbound listbox duplicates displaymember after edit Pin
Mark Payton27-Jan-05 10:45
Mark Payton27-Jan-05 10:45 
GeneralRounding Pin
superprogrammingdude27-Jan-05 10:25
superprogrammingdude27-Jan-05 10:25 
GeneralRe: Rounding Pin
Dave Kreskowiak27-Jan-05 10:37
mveDave Kreskowiak27-Jan-05 10:37 
GeneralCheckBoxes in Detail of Master/Detail Datagrid Pin
dhorne4127-Jan-05 9:56
dhorne4127-Jan-05 9:56 
GeneralInstall windows service application Pin
leezardd27-Jan-05 9:07
leezardd27-Jan-05 9:07 
GeneralRe: Install windows service application Pin
Dave Kreskowiak27-Jan-05 10:34
mveDave Kreskowiak27-Jan-05 10:34 
GeneralRe: Install windows service application Pin
leezardd28-Jan-05 5:09
leezardd28-Jan-05 5:09 
QuestionCommand execute??? Pin
charleslau285527-Jan-05 4:25
charleslau285527-Jan-05 4:25 
AnswerRe: Command execute??? Pin
Dave Kreskowiak27-Jan-05 4:52
mveDave Kreskowiak27-Jan-05 4:52 

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.