Click here to Skip to main content
15,886,199 members
Home / Discussions / Database
   

Database

 
Questionhow to connect table from database to table from another database? Pin
salm abdullsamad4-Mar-17 6:17
salm abdullsamad4-Mar-17 6:17 
AnswerRe: how to connect table from database to table from another database? Pin
Michael_Davies4-Mar-17 6:57
Michael_Davies4-Mar-17 6:57 
QuestionFinding status of which Jobs ran successfully and which are failed on daily basis Pin
indian1432-Mar-17 8:38
indian1432-Mar-17 8:38 
AnswerRe: Finding status of which Jobs ran successfully and which are failed on daily basis Pin
Afzaal Ahmad Zeeshan2-Mar-17 9:09
professionalAfzaal Ahmad Zeeshan2-Mar-17 9:09 
QuestionHow to sync two or more collocation database server? Pin
Gilbert Consellado1-Mar-17 17:59
professionalGilbert Consellado1-Mar-17 17:59 
AnswerRe: How to sync two or more collocation database server? Pin
Eddy Vluggen6-Mar-17 2:56
professionalEddy Vluggen6-Mar-17 2:56 
GeneralRe: How to sync two or more collocation database server? Pin
Gilbert Consellado7-Mar-17 1:58
professionalGilbert Consellado7-Mar-17 1:58 
QuestionFoxpro DBF, Joining a table with multiple columns that can return more than 1 record and projecting it into a list(Of Pin
jkirkerx27-Feb-17 8:07
professionaljkirkerx27-Feb-17 8:07 
Well I had a simple table that contained 2 contact records, in which I was able to do a join and get the 2 contacts to send emails to.
Th entire program was based in this everywhere
Then the customer wanted to be able to do 3, 4 and 5 contacts to send emails to, So I said OK to make it unlimited.
I created a new table with 1 contact record.
So now I have an invoice that is a single record, and a list of contacts that can be multiple.
I forgot about the double record if my join has 2 contacts, so that's out the window.

I have no clue what would be the best solution, perhaps start again on the design; maybe someone can point me in the right direction here.
My last resort may be loading all the contacts in a 2nd query, and using linq to match and populate.
<pre>queryString += _
" UNION ALL " & _
" SELECT  " & _
"  h.FINVNO " & _
", h.FCUSTNO " & _
", h.FCOMPANY " & _
", h.FSALESPN " & _
", h.FSHIPVIA " & _
", h.FORDDATE " & _
", h.FSHIPDATE " & _
", h.FNTAXAMT " & _
", (SELECT a.FADDR1 FROM ARCUS01.dbf a WHERE h.FCUSTNO = a.FCUSTNO) AS FADDR1 " & _
", (SELECT j.FPRINT FROM ARCEMJN.dbf j WHERE h.FINVNO = j.FINVNO) AS FPRINT " & _
", (SELECT j.FSENT FROM ARCEMJN.dbf j WHERE h.FINVNO = j.FINVNO) AS FSENT " & _
", (SELECT p.FBATCH FROM ARPRINT.dbf p WHERE h.FINVNO = p.FINVNO) AS FBATCH " & _
", (SELECT ce.FID, ce.FCUSTNO, ce.FCHECK, ce.FNAME, ce.FEMAIL FROM ARCEM02.dbf ce WHERE FCUSTNO = h.FCUSTNO) AS CONTACTS " & _
" FROM ARINV01H.dbf h " & _
" WHERE h.FSHIPDATE = @startDate "


Here, I started using List to return the records, so I can do further processing
I made a model with the contacts as a list. I'm in uncharted waters here, and I'm not sure if I do get the SQl to work, that I can populate the contacts using this method.
pResults.Add(New model_invoice_index() With {
     .FINVNO = If(reader.IsDBNull(0), String.Empty, reader.GetString(0)),
     .FCUSTNO = If(reader.IsDBNull(1), String.Empty, reader.GetString(1)),
     .FCOMPANY = If(reader.IsDBNull(2), String.Empty, reader.GetString(2)),
     .FSALESPN = If(reader.IsDBNull(3), String.Empty, reader.GetString(3)),
     .FSHIPVIA = If(reader.IsDBNull(4), String.Empty, reader.GetString(4)),
     .FORDDATE = If(reader.IsDBNull(5), New DateTime(89, 1, 1), reader.GetValue(5)),
     .FSHIPDATE = If(reader.IsDBNull(6), New DateTime(89, 1, 1), reader.GetValue(6)),
     .FNTAXAMT = If(reader.IsDBNull(7), 0.0, reader.GetValue(7)),
     .FADDR1 = If(reader.IsDBNull(8), String.Empty, reader.GetString(8)),
     .FPRINT = If(reader.IsDBNull(9), False, reader.GetValue(9)),
     .FSENT = If(reader.IsDBNull(10), False, reader.GetValue(10)),
     .FBATCH = If(reader.IsDBNull(11), False, reader.GetValue(11)),
     .FCONTACTS = New List(Of model_invoice_contacts()) With {
        dsdaasd
     }
}
If it ain't broke don't fix it

Questionintegration of flash to javadb Pin
Member 1302448026-Feb-17 19:38
Member 1302448026-Feb-17 19:38 
AnswerRe: integration of flash to javadb Pin
Mycroft Holmes26-Feb-17 21:53
professionalMycroft Holmes26-Feb-17 21:53 
GeneralRe: integration of flash to javadb Pin
Richard Deeming26-Feb-17 23:43
mveRichard Deeming26-Feb-17 23:43 
QuestionGetting data Pin
Member 1302296325-Feb-17 0:23
Member 1302296325-Feb-17 0:23 
AnswerRe: Getting data Pin
Richard MacCutchan25-Feb-17 20:48
mveRichard MacCutchan25-Feb-17 20:48 
Questionc# to call MySQL Update Stored Proc error Pin
jonmy24-Feb-17 0:00
jonmy24-Feb-17 0:00 
AnswerRe: c# to call MySQL Update Stored Proc error Pin
Richard Deeming24-Feb-17 0:26
mveRichard Deeming24-Feb-17 0:26 
GeneralRe: c# to call MySQL Update Stored Proc error Pin
jonmy24-Feb-17 0:37
jonmy24-Feb-17 0:37 
QuestionSave a Query as a View issue Pin
john_berman21-Feb-17 11:35
john_berman21-Feb-17 11:35 
AnswerRe: Save a Query as a View issue Pin
Richard Deeming21-Feb-17 12:04
mveRichard Deeming21-Feb-17 12:04 
QuestionTime Variance Query works - Sorry it needs a tweak Pin
john_berman21-Feb-17 9:48
john_berman21-Feb-17 9:48 
QuestionMySql Resource Pin
BobbyStrain20-Feb-17 14:12
BobbyStrain20-Feb-17 14:12 
AnswerRe: MySql Resource Pin
Peter Leow20-Feb-17 16:08
professionalPeter Leow20-Feb-17 16:08 
QuestionTricky Query that includes a time difference Pin
john_berman20-Feb-17 6:09
john_berman20-Feb-17 6:09 
AnswerRe: Tricky Query that includes a time difference Pin
Richard MacCutchan20-Feb-17 6:22
mveRichard MacCutchan20-Feb-17 6:22 
GeneralRe: Tricky Query that includes a time difference Pin
john_berman20-Feb-17 6:45
john_berman20-Feb-17 6:45 
GeneralRe: Tricky Query that includes a time difference Pin
Richard Deeming20-Feb-17 6:52
mveRichard Deeming20-Feb-17 6: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.