|
ok ..i will try that! Thanks!
modified 7-Jan-19 21:02pm.
|
|
|
|
|
It was supposed to be a picture in my last post!!! i can not see it :S
modified 7-Jan-19 21:02pm.
|
|
|
|
|
The forum does not support images, so that is correct.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
i have used it as a link.. a link to the image!!
modified 7-Jan-19 21:02pm.
|
|
|
|
|
I don't see any link either; you can still edit the post if desired though.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hi again.. so i have all this built up and functional
I am now thinking on making a fine GUI to it... and i believe i just miss the Line In volume controller here!!
Despite of only being able to record in 16-bits / 2 chans and 44.1Khz/48Khz .. i am enjoying to do this....
... it is working fine .. i do not have a audiocard selector wich would be good but it is recording well through my realtek line in : ) .. maybe i do some more research and add a way to toggle between line in and mic : )
For now i realy just would like to have the Line In volume controller : )
Regards,
Duarte
modified 7-Jan-19 21:02pm.
|
|
|
|
|
I suspect that limiting the line in (other than via the "master volume" of the line in device) would also degrade the signal to some extent from the "pure" one coming out of the line out of the sender.
Like playing the "headphone output" from an mp3 player that does not have a line out through your car's audio device.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
well..i think i ended my gadget.. i was not able to understand the exampes and C# code...so i left it a bit incomplete (no Line In volume control)
Anyway..i think you might like to see it...
so here it is: http://www.beatassist.eu/gadgets.htm
It is called KuiKR.. records 16-bits 44.1Khz/48Khz and converts .wav to .mp3 (128/192/320Kbps)
It is a simple recording tool for quick recording Line In/Mic ... i am going to use it in my Djing to record MixSets and convert them for post upload in the web. : )
Thanks, regards and till next time,
Duarte
modified 7-Jan-19 21:02pm.
|
|
|
|
|
How to Download File and Upload in Datagridview VB.NET ?
|
|
|
|
|
|
Not a lot to go on really, hence a short reply.
If you want to upload a file you'll need to call the OpenFileDialog
If you want to download(save) then you will need to call the SaveFileDialog
you will need to hook these classes in your cell click events or double click events depending on what you want the user to do.
If I have missed the mark (i.e. got it wrong!) please update your answer with some more information explaining a lot more than what you have stated.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
I get 2 extra records after grouping, in which there is no FSALESREP and it's just blank after grouping.
Is this something I can fix in Linq, or do I need to go back to the SQL call to the FoxPro database?
" SELECT" & _
" h.FSALESPN " & _
" , h.FPERIOD " & _
" , h.FCSAMT " & _
" FROM ARINV01H.dbf h " & _
" WHERE h.FSHIPDATE >= @FSTART " & _
" AND h.FSHIPDATE <= @FSTOP "
Dim gSalesReps As List(Of model_salesChampions) = invoices.GroupBy(Function(sR) sR.FSALESREP).Select(Function(cl) New model_salesChampions() With {
.salesrep_ID = cl.First().FSALESREP,
.salesrep_Name = String.Empty,
.P1 = cl.Where(Function(p1) p1.FPERIOD = rT & "01").Sum(Function(p1) p1.FCSAMT),
.P2 = cl.Where(Function(p2) p2.FPERIOD = rT & "02").Sum(Function(p2) p2.FCSAMT),
.P3 = cl.Where(Function(p3) p3.FPERIOD = rT & "03").Sum(Function(p3) p3.FCSAMT),
.P4 = cl.Where(Function(p4) p4.FPERIOD = rT & "04").Sum(Function(p4) p4.FCSAMT),
.P5 = cl.Where(Function(p5) p5.FPERIOD = rT & "05").Sum(Function(p5) p5.FCSAMT),
.P6 = cl.Where(Function(p6) p6.FPERIOD = rT & "06").Sum(Function(p6) p6.FCSAMT),
.P7 = cl.Where(Function(p7) p7.FPERIOD = rT & "07").Sum(Function(p7) p7.FCSAMT),
.P8 = cl.Where(Function(p8) p8.FPERIOD = rT & "08").Sum(Function(p8) p8.FCSAMT),
.P9 = cl.Where(Function(p9) p9.FPERIOD = rT & "09").Sum(Function(p9) p9.FCSAMT),
.P10 = cl.Where(Function(p10) p10.FPERIOD = rT & "10").Sum(Function(p10) p10.FCSAMT),
.P11 = cl.Where(Function(p11) p11.FPERIOD = rT & "11").Sum(Function(p11) p11.FCSAMT),
.P12 = cl.Where(Function(p12) p12.FPERIOD = rT & "12").Sum(Function(p12) p12.FCSAMT)
}).ToList()
21st Century Globalism has become Socialism on a planetary scale, in which the unequal treaties of the past have come back into play.
|
|
|
|
|
Assuming FSALESPN and FSALESREP represent the same thing, you could add a filter to your query:
SELECT
h.FSALESPN,
h.FPERIOD,
h.FCSAMT
FROM
ARINV01H.dbf h
WHERE
h.FSHIPDATE >= @FSTART
AND
h.FSHIPDATE <= @FSTOP
AND
h.FSALESPN Is Not Null
Or you could add a filter to your LINQ query:
Dim gSalesReps As List(Of model_salesChampions) = invoices
.Where(Function(sR) sR.FSALESREP IsNot Nothing)
.GroupBy(Function(sR) sR.FSALESREP, Function(salesRep, cl) New model_salesChampions() With {
.salesrep_ID = salesRep,
.salesrep_Name = String.Empty,
.P1 = cl.Where(Function(p1) p1.FPERIOD = rT & "01").Sum(Function(p1) p1.FCSAMT),
...
}).ToList()
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I don't why I didn't think of that. Or perhaps I did but tried to use it after the GroupBy resulting in an error.
Thanks Richard!
21st Century Globalism has become Socialism on a planetary scale, in which the unequal treaties of the past have come back into play.
|
|
|
|
|
All-
I have a datagridview on a form, with associated textboxes and such - as the user selects a row in the dgv, the textboxes show the appropriate record - for updating information on that record.
On a main menu form - I have a production line, and model year value that determines what data the user sees.
I am applying a filter to the bindingsource for the dgv to limit the information based on the production line and model year for which the user works on.
my filter looks like this -
me.TblPCRBindingSource.Filter = "ModelYear = " & (myear) And "Line = " & CInt(txtLine.Text)
where myear is a double as we can have 2017.5 model year (for mid year changes) and line I'm reading a textbox, but the datatype in the table is integer - so I convert.
If I do filter for one field - it works for that field. as soon as I add "AND" and the other field - they cancel each other out and I get ALL records.
I'm baffled as to why - banging head on wall.
please help-
thank you -
|
|
|
|
|
Member 11089831 wrote: "ModelYear = " & (myear) And "Line = " & CInt(txtLine.Text)
Shouldn't there be a space before the "Line?
Otherwise the resultfilter contents becomes "ModelYear = 2017Line = 0", and 2017Line will be an invalid value for a integer-field in the table, making the filter invalid.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
yes, there should be a space - this is how I currently have it -
me.TblPCRBindingSource.Filter = "ModelYear = " & (myear) And "Line = " & CInt(txtLine.Text)
it however, does not work.
it's like it turned the filter off.
if I make them separate lines like this:
Me.TblPCRBindingSource.Filter = "Line = " & CInt(txtLine.Text)
Me.TblPCRBindingSource.Filter = "ModelYear = " & (myear)
then only 1 filter works - usually the last one - as it follows order of operations.
the msdn documentation tell you to use And as I have above, but when I do with different data types .. they don't filter at all.
|
|
|
|
|
Shouldn't the And be inside the string?
me.TblPCRBindingSource.Filter = "ModelYear = " & (myear) & " And Line = " & CInt(txtLine.Text)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
If I do add the "and" within the statement, I get an end of statement expected error.
Me.TblPCRBindingSource.Filter = "ModelYear = " & (myear) "And Line = " & CInt(txtLine.Text)
so this, doesn't work.
|
|
|
|
|
You need a space before the And :
Me.TblPCRBindingSource.Filter = "ModelYear = " & (myear) & " And Line = " & CInt(txtLine.Text)
Otherwise, your filter will end up as:
ModelYear = 2017And Line = 42
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
modified 27-Jan-17 13:36pm.
|
|
|
|
|
This:
me.TblPCRBindingSource.Filter = "Line = " & CInt(txtLine.Text) And " ModelYear = " & (myear) gives me everything.
and this:
e.TblPCRBindingSource.Filter = "Line = " & CInt(txtLine.Text) " And ModelYear = " & (myear) gives me and end of statement error at the And ModelYear. It wants it like the first example - yet the first example isn't working.
this is coded in VB 2015
|
|
|
|
|
The first one is completely wrong.
- If you compile with
Option Strict On , you'll get a compiler error - BC30512 Option Strict On disallows implicit conversions from 'String' to 'Long'. - If you compile with
Option Strict Off , you'll get a runtime error - Conversion from string "line = 42" to type 'Long' is not valid.
The second one is missing the & between CInt(...) and " And ..." :
e.TblPCRBindingSource.Filter = "Line = " & CInt(txtLine.Text) & " And ModelYear = " & (myear)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I am attempting to build a command line tool that will create shortcuts for an application on the start menu and desktop. I have existing code that I use elsewhere to create the shortcuts. However, the program looks at two different files one file has only the site code and the other has the other information needed to created the shortcut by site for a whole region. The idea is to go through both lines until it finds the 3 letter abbreviation for the site in both files. For example one file only contains BEC (sites2.txt - the city) and the other file (R03Sites2.csv - Region) contains 50 lines with a different cities and all the pertinent information.
Sub Main()
Dim strSiteCode
Dim strVistaFQDN
Dim strPort
Dim arrStr
Using sr As New StreamReader("c:\dell\R03Sites2.csv")
Dim line As String
Do
line = sr.ReadLine()
Dim Sites As String = My.Computer.FileSystem.ReadAllText("c:\dell\Sites2.txt")
If Not (line Is Nothing) Then
Console.WriteLine("Start processing loop")
arrStr = Split(sr.ReadLine, ",")
strSiteCode = arrStr(0)
strVistaFQDN = arrStr(1)
strPort = arrStr(2)
Console.WriteLine("Array populated... Enter if then statement")
If Trim(Sites) = Trim(strSiteCode) Then
Console.WriteLine(Trim(Sites) & " , " & Trim(strSiteCode))
Console.WriteLine("s=" & strVistaFQDN & " p=" & strPort)
Console.WriteLine("Successfully processed!")
Exit Do
Else
Console.WriteLine("Error: No Matching Information in the Sitecode and R03sites files!")
End If
End If
Loop Until line Is Nothing
End Using
End Sub
Here is the output:
\Dell>bcmass
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
Start processing loop
Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Array.InternalGetReference(Void* elemRef, Int32 rank, Int32* pIndices)
at System.Array.GetValue(Int32 index)
at Microsoft.VisualBasic.CompilerServices.Symbols.Container.GetArrayValue(Object[] Indices)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.InternalLateIndexGet(Object Instance, Object[] Arguments, String[] Argument
Names, Boolean ReportErrors, ResolutionFailure& Failure, Boolean[] CopyBack)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateInvokeDefault(Object Instance, Object[] Arguments, String[] Argum
entNames, Boolean ReportErrors, Boolean[] CopyBack)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateIndexGet(Object Instance, Object[] Arguments, String[] ArgumentNames)
at BCMASS.Module1.Main()
|
|
|
|
|
You're getting the exception because you've read a line from the file which doesn't contain two commas.
That's probably caused by the fact that you're skipping every other line:
line = sr.ReadLine()
If Not (line Is Nothing) Then
arrStr = Split(sr.ReadLine, ",")
You need to change that to re-use the line you've already read. You also need to check that the array returned from Split contains enough elements:
line = sr.ReadLine()
If line IsNot Nothing Then
arrStr = Split(line, ",")
If arrStr.Length >= 3 Then
strSiteCode = arrStr(0)
strVistaFQDN = arrStr(1)
strPort = arrStr(2)
...
You should also move the code that reads the contents of Sites2.txt outside of the loop. As it stands, you're reading the entire file for every line in Sites2.csv , even though you're not changing it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for the response. I made the suggested changes and am still having issues. This is what I have now:
Sub Main()
Dim strSiteCode
Dim strVistaFQDN
Dim strPort
Dim arrStr
Dim Sites As String = My.Computer.FileSystem.ReadAllText("c:\dell\Sites2.txt")
Using sr As New StreamReader("c:\dell\R03Sites3.csv")
Dim line As String
Do
line = sr.ReadLine()
Console.WriteLine("line = " & line)
Console.WriteLine("Start processing loop")
If line IsNot Nothing Then
arrStr = Split(line, ",")
If arrStr.Length >= 3 Then
strSiteCode = arrStr(0)
strVistaFQDN = arrStr(1)
strPort = arrStr(2)
Console.WriteLine(Trim(Sites) & " , " & Trim(strSiteCode))
Console.WriteLine("s=" & strVistaFQDN & " p=" & strPort)
Console.WriteLine("Array populated... Enter if then statement")
If Trim(Sites) = Trim(strSiteCode) Then
Console.WriteLine("Successfully processed!")
Exit Do
Else
Console.WriteLine("Error: No Matching Information in the Sitecode and R03sites files!")
End If
End If
End If
Loop Until line Is Nothing
End Using
End Sub
Here is the output (I cut the R03 file down to 2 entries):
C:\Dell>bcmass
line = BEC,test.beckley.com,19233
Start processing loop
BEC,BEC
, BEC
s=test.beckley.com p=19233
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
line = BIR,test.birmingham.com,19230
Start processing loop
BEC,BEC
, BIR
s=test.birmingham.com p=19230
Array populated... Enter if then statement
Error: No Matching Information in the Sitecode and R03sites files!
line =
Start processing loop
The bold entries should read BEC,BEC and BEC,BIR instead of BEC,BEC,BEC and BEC,BEC,BIR. I'm not sure how make the if then statement read only the first BEC for the Sites2.txt file and the Site code out of R03sites3.csv and then continue processing/reading the matching information.
|
|
|
|