Click here to Skip to main content
15,915,093 members
Home / Discussions / Database
   

Database

 
GeneralRe: Convert SqlDataReader to DataSet Pin
Colin Angus Mackay27-Jan-05 22:51
Colin Angus Mackay27-Jan-05 22:51 
GeneralDetermining the ID of an inserted row Pin
Ahmed Hefny27-Jan-05 21:26
Ahmed Hefny27-Jan-05 21:26 
GeneralRe: Determining the ID of an inserted row Pin
Colin Angus Mackay27-Jan-05 22:58
Colin Angus Mackay27-Jan-05 22:58 
Generalsaving and retrieving image data Pin
Rashid_Mehmood27-Jan-05 20:01
Rashid_Mehmood27-Jan-05 20:01 
GeneralRe: saving and retrieving image data Pin
Colin Angus Mackay28-Jan-05 0:39
Colin Angus Mackay28-Jan-05 0:39 
GeneralRe: saving and retrieving image data Pin
Mike Dimmick28-Jan-05 2:38
Mike Dimmick28-Jan-05 2:38 
GeneralRe: saving and retrieving image data Pin
Mr.Cooper9-Feb-05 1:01
Mr.Cooper9-Feb-05 1:01 
Generaldatatable only working occasionally Pin
lxhan27-Jan-05 18:49
lxhan27-Jan-05 18:49 
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, for any help!
GeneralRe: datatable only working occasionally Pin
Colin Angus Mackay27-Jan-05 23:08
Colin Angus Mackay27-Jan-05 23:08 
GeneralRe: datatable only working occasionally Pin
lxhan1-Feb-05 3:33
lxhan1-Feb-05 3:33 
GeneralQuerying CSV db with Jet and ADO Pin
wilsonian27-Jan-05 12:26
wilsonian27-Jan-05 12:26 
GeneralRe: Querying CSV db with Jet and ADO Pin
Rob Graham31-Jan-05 5:15
Rob Graham31-Jan-05 5:15 
GeneralRe: Querying CSV db with Jet and ADO Pin
wilsonian31-Jan-05 8:50
wilsonian31-Jan-05 8:50 
GeneralRe: Querying CSV db with Jet and ADO Pin
Rob Graham31-Jan-05 11:14
Rob Graham31-Jan-05 11:14 
GeneralRe: Querying CSV db with Jet and ADO Pin
wilsonian31-Jan-05 11:53
wilsonian31-Jan-05 11:53 
GeneralRe: Querying CSV db with Jet and ADO Pin
Rob Graham31-Jan-05 14:44
Rob Graham31-Jan-05 14:44 
GeneralRe: Querying CSV db with Jet and ADO Pin
wilsonian31-Jan-05 16:34
wilsonian31-Jan-05 16:34 
GeneralRe: Querying CSV db with Jet and ADO Pin
Rob Graham1-Feb-05 2:42
Rob Graham1-Feb-05 2:42 
GeneralRe: Querying CSV db with Jet and ADO Pin
wilsonian1-Feb-05 8:52
wilsonian1-Feb-05 8:52 
GeneralSet RowCount issue in query containing function tables Pin
-Dr_X-27-Jan-05 4:52
-Dr_X-27-Jan-05 4:52 
GeneralRe: Set RowCount issue in query containing function tables Pin
-Dr_X-27-Jan-05 5:14
-Dr_X-27-Jan-05 5:14 
Generallock triggers while executing a transaction Pin
mhmoud rawas26-Jan-05 0:28
mhmoud rawas26-Jan-05 0:28 
GeneralRe: lock triggers while executing a transaction Pin
tojamismis27-Jan-05 7:35
tojamismis27-Jan-05 7:35 
GeneralMSDE Setup.Exe and Reinstall Pin
Blake V. Miller25-Jan-05 18:28
Blake V. Miller25-Jan-05 18:28 
QuestionCOMException--Why? Pin
mysorian25-Jan-05 18:02
professionalmysorian25-Jan-05 18:02 

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.