Jonathan Willcock

Jan 27 10:44
If it is not clear how to use it let me know, but it was designed to use the same syntax as SqlBulkCopy
Jan 27 10:38
Yes there is another link. But I repeat it here:
Jan 27 10:32
I gave code for both - the technique is similar, although IEnumerable uses Reflection
Jan 27 10:32
It is included in that other answer. Simply follow the link
Jan 27 10:30
Then use a staging table and take my bulk insert answer. I give code for IEnumerable and DataTable
Jan 27 10:25
If you look in the duplicate, the OP added json serialization code in the question. That is why I didn't repeat it in my answer. If that is not clear to you, let me know
Jan 27 10:23
My answer to the duplicate question shows how to read the json parameter directly in PostgreSQL
Jan 27 10:23
Bulk insert to a staging table is without doubt the fastest way, unless your data is very small
Jan 27 10:23
Does this answer your question? Error in calling Postgres stored procedure using C#. The answer I gave there serialised using json. You can also do the same with XML. As an alternative, you could bulk insert into a staging table and then change your function to read from the staging table, See here for help with bulk insert
 

SO Close Vote Reviewers

This room is for support and discussion about reviewing and co...
Mar 17, 2023 07:47
Thanks
Mar 17, 2023 07:47
Thanks for the FAQ link. I will use in future. I take it that it is not possible to edit a message?
Oct 19, 2022 07:30
Needs Details or ClarityWCF returns non valid XML?
 

 SOCVR Request Graveyard

This room is ONLY to receive action requests (cv-pls, etc.) fr...
Mar 17, 2023 07:42
stackoverflow.com/questions/75764686/… Not reproducible (culprit was column name nowhere mentioned in question)
 
Oct 21, 2021 08:34
You too
Oct 21, 2021 08:34
Quite honestly it does not look too much of a Hack to me. Your problem is more than you have a Short Text field to store numbers. That is what I call a hack
Oct 21, 2021 08:33
Not that I know of in MS Access. In other DBs you can do IF EXISTS() THEN .. ELSE ..
Oct 21, 2021 08:21
Or whatever number instead of 9999999 is guaranteed to be the highest
Oct 21, 2021 08:21
OK then you simply go ORDER BY CINT(IIF(Field3='No Number',9999999,Field3)) DESC
Oct 21, 2021 08:19
You wanted MAX Field3 right? Surely 10 is more than No Number??????
Oct 21, 2021 08:18
That is what it should return!
Oct 21, 2021 08:15
Yes it will return No Number! The IIF CInt combination is only for the ORDER BY; not for the SELECT. The SELECT will show No Number
Oct 21, 2021 08:07
It makes sense. The IIF converts No Number to 0, and after that CInt can work, since all other values are integers. Are you sure that you do not have values such as NoNumber or extra spaces
Oct 21, 2021 08:05
And it works as expected. Something must be different with yours
Oct 21, 2021 08:05
Field1 Field2 Field3
Aden Blue 1
Colin Orange 3
Jay Red 2
Jay2 Red 5
Jay3 Red No Number
Oct 21, 2021 08:04
I have following records:
Oct 21, 2021 08:04
SELECT TOP 1 Field1, Field2, Field3
FROM MyTable
ORDER BY CINT(IIF(Field3='No Number',0,Field3)) DESC;
Oct 21, 2021 08:04
This is my query:
Oct 21, 2021 07:20
Can you try my version just as a query in Access. This is what I did and it works correctly.
Oct 21, 2021 07:12
Yes
 
Aug 12, 2021 12:35
Sorry but your task just keeps getting worse. Look at EPOGEN. They all have numbers before the dosage, so your split no longer works
Aug 12, 2021 11:52
I was hoping to replace the units with a placeholder of standard length (eg '##123§§' where 123 is an id starting at 100 for your list). But that fails because CALCITRIOL 0.25mcg CAPSULE (EA matches 3 times: mcg CAP and %. CAP we could deal with by casing but % is horrible.
Aug 12, 2021 11:48
Ouch you have the wildcard symbol (%) in your list. That makes a replace almost impossible
Aug 12, 2021 11:33
In your examples this list starts immediately after the number (0.25mcg) Is that true for cream etc?
Aug 12, 2021 11:30
Do you have this list conveniently in a table?
Aug 12, 2021 11:17
Ist it always mcg or are there other units as well? If so do they all have the same length?
Aug 12, 2021 11:17
I was talking about the units (assuming mcg are units?)
Aug 12, 2021 11:17
In a meeting at the moment. I'll get back to you
 
Nov 14, 2019 12:57
Thanks you too. Please mark my answer as accepted
Nov 14, 2019 12:51
Sent. You will see that I used GetOleDbSchemaTable to get the SheetName. I was a bit blind at first - I did not notice the space before Entergate. I really advise you not to use spaces (particularly at the beginning) in names - it almost always causes problems!
Nov 14, 2019 12:48
Of course
Nov 14, 2019 12:43
Note also to get values for 2017-11-01 you need to set from to 2017-10-31 and to to 2017-11-02. If you want the dates to be inclusive then use AddDays(-1) on the first and AddDays(1) on the second eg dateTimePicker1.Value.AddDays(-1).ToString("yyyy-MM-dd")
Nov 14, 2019 12:35
OK for me it works even with two header rows. As soon as the filter is applied, the first row of data (which is the second row of headers) effectively gets removed. However, you do need to make sure when clicking the button that the two dateTimePickers have relevant values. By default DateTimePicker is set to today, which means that the filter definitely won't work on your data
Nov 14, 2019 12:27
Are you still there?
Nov 14, 2019 12:00
One second I am experimenting
Nov 14, 2019 11:55
OK I see the problem. You appear to have two header rows?
Nov 14, 2019 11:50
ok thanks
Nov 14, 2019 11:45
OK then there is something wrong with your selected sheet. Can you please email me the spreadsheet [email protected] If it is sensitive data, just delete and replace with junk values. I just need the structure
Nov 14, 2019 11:41
Sorry. What was the count for dt.Rows?
Nov 14, 2019 11:38
OK that is your problem. What is the exact value of your filter?
Nov 14, 2019 11:32
Have you tried?