|
Ah well I was close - glad you got it sorted.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Have you tried putting [] (square brackets) around the 40Percent?
expression = "[40Percent] = 0.355";
The reason I mention that is because as an example in SQL Server you can't have a number at the beginning of a field name, or any object name for that matter. So you have to enclose the name with square brackets.
Kelly Herald
Software Developer
|
|
|
|
|
Good morning and Thank you.
You were correct. As soon as I placed brackets around the "40Percent", it functioned as expected. But, I went ahead and renamed the tables and its now "FortyPercent" and it is still function as previously.
Thank you for your assistance.
Richard
Disable Vet
Grandfather
Pain in the @ss
|
|
|
|
|
WWhat database? Your expression isn't SQL92.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
As Kelly has said, column names starting with numbers are generally a mistake and need to be enclosed in square brackets in order to be recognised as a column name rather than as a number followed by an operator:
expression = "[40Percent] = 0.355"; Though to be honest, having a column called "40Percent" is probably a bad idea as it relies on the original value column not being changed without updating that column as well. And we all know how easy it is to get data out of step and the problems that causes later!
But to add to that, don't use screen grabs for error messages: use the "Copy Details" link at the bottom of the dialog to get a text version, and paste that into your question - it makes it easier for us and safer for you because many people won't (or can't) go near "random sites" at work as you never know what you will get before you go there!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Kelly was correct, as soon as I placed brackets around the "[40Percent]" it functioned without any error messages. But, I went and renamed the tables, removing any numbers "FortyPercent", from the beginning of the name.
As for the screen grabs, I apologize, thats what we use at my work and its easier. But, I understand and will start using the Copy Details link to provide the information.
Thank you for the assistance and education.
Richard
Disable Vet
Grandfather
Pain in the @ss
|
|
|
|
|
You're welcome!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
As others have already suggested enclosing the column name in brackets (which is what I was originally going to reply) and you have already used a different work around, I will make another observation.
Comparing a non-integer number for equality is liable to not give the result that you are looking for. 0.355 will probably be internally represented as something like 0.35499999999 and the value in your [40Percent] column may also be similarly held but to a different precision; so, although they may seem to be equal, they might not be exactly equal. The normal way of fixing this is to allow a level of imprecision in the comparison test, e.g. bound the expression with something like [40Percent] BETWEEN 0.35495 AND 0.35505 , but, unfortunately, the BETWEEN keyword is not supported in the DataTable Select() method; so you'd have to do something like [40Percent] > 0.35495 AND [40Percent] < 0.35505
|
|
|
|
|
- First of all, I am sorry to post this very unrelated question here, but I literally have no idea where I can get a normal answer on the web, for this kind of problem. If you can indulge me, and try to 'debug' this problem with me, would be awesome. I will understand if nothing can be done, when we will reach that point. I personally reached that point myself. That's why I come to you, my old c# friends.
- So...
- Because win7 is no more taken care by Microsoft, all its auto-updates are no more.
I clearly remember after I freshly installed a new copy of windows7, the auto-updates were doing their magic and all my usb drivers were functioning with one single click. Now, that 1 click function is no more. Now, all my usb drivers are errors in Device manager. And what is worse than that, something in windows, is not recognizing the device usb even after I installed its original driver. Why? Remember those (KB2908783XXXXX) packages? from Microsoft ? I believe it is a package somewhere, specifically for windows7 that is taking care of this USB problem I have here. But I dont know which it is and it would be the easy fix with it.
- I was as thorough as I could. I already installed everything listed here manually:
Nvidia drivers and motherboard drivers also updated to their latest versions.
1. windows6.1-kb976932-x64.exe (Windows 7 and Windows Server 2008 R2 Service Pack 1 (KB976932)(is officially removed from Microsoft website)) but I install it offline.
2. Microsoft .NET Framework 4.8 for Windows 7.exe
3. IE11 (originally w7 comes with IE8) so IE11 is an update to that. And I managed to update it, manually.
4. a bunch of: visual c++ redist 2010 to 2015 sp1 x86.exe
- I still got a bunch of errors in Device Manager:
- I had a nasty error in Device Manager for "MTP" (Media Transfer Protocol) and I believe I solve it by installing: AMD USB 3.0 hub and host controller driver for Windows 7 (64-bit)
Now in Device manager there is no MTP error present. But Im not completly sure though. I am skeptical. I installed the latest version of it, from 2022, that's why im skeptical.
Even with it installed, I can not see the directory tree inside the Phone as I was able to see before. And it should !
- Now I have a "CDC Serial" error left. I actually find an 'Android_CDC_Driver' and from that package I could install the actual driver which is this file: "usb2ser_Win7.inf". I install it, it worked, I got rid of the "CDC Serial" error in the Device Manager, I actually got a new Port in there. All seem to be fine, right? I connect the phone to PC, the PC is recognizing the phone device correctly, Device Manager is updating accordingly and is showing everything is working optimal, but the only major problem remains the fact I can not see inside my phone directory branch (like I was able before windows installation). Nothing !
https://i.imgur.com/8uV5oUC.jpg[^]
Now I un-installed this (usb2ser_Win7.inf) last driver, since it is the most dubious.
I am also left with a bunch of PCI Devices, drivers errors in Device Manager.
See the pictures:
https://i.imgur.com/rTJuttF.jpg[^]
https://i.imgur.com/LMyROW1.jpg[^]
If you can help me with this very technical problem... you're my friend forever.
Thank you and I hope we can reach a workable answer.
modified 10-Feb-22 5:03am.
|
|
|
|
|
To be honest, you would be a load better off installing a supported OS instead of 7 - if nothing else, you would get security improvements as Win 7 hasn't had any security patches since Jan 2020, and you are running on 2016 service pack (unless you found a copy of "Windows 7 SP1 Convenience Rollup" which added a ton of patches to SP1 which will likely include the one you need.
You may be able to get that via this link: 64 bit[^] or 32 bit[^]
I'm on Win 11, so I obviously can't test them ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thank you very much for your fast response and for this new patch that I never heard of it.
I downloaded it, I try to install it, and I get this:
https://i.imgur.com/OWkxhcq.jpg[^]
My impression is that I have to install something else before this thing to work.
|
|
|
|
|
As I said I can't test it for you, and I can't see your computer - so I'd have to guess. Did you install SP1 first?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Message Closed
modified 10-Feb-22 8:19am.
|
|
|
|
|
Message Closed
modified 10-Feb-22 8:19am.
|
|
|
|
|
Message Closed
modified 10-Feb-22 8:19am.
|
|
|
|
|
Ok, everything is now installed. I successfully installed "Windows 7 Convenience Rollup" patch.
BUT - the problem still remain unresolved - the same errors in Device Manager. Nothing changed there.
https://i.imgur.com/LMyROW1.jpg[^]
|
|
|
|
|
I re-checked on the official website and re-installed all my 'PRIME B450M-A' motherboard drivers.
I always suspected these drivers are doing some monkey bizniz.
But still, after the "Convenience Rollup" patch, after the oficial and slightly updated drivers of my motherboard, still no change in the bunch of errors in my Device Manager. It is exactly as before. No change.
You did helped me.
I start to believe is a motherboard driver problem that I have here. Specifically for w7. Although I did not had absolutly any kind of errors in Device Manager in my last (auto-updated) version of windows7. It is either: 1-Microsoft didnt share everything; or 2-the motherboard drivers concentrated on w10 and w11 but w7 left it float like a useless label. Damn im pissed off. This is my best guess the problem might be. I'll have to take the fight to them, if they will even answer to my questions... hmmm.
But we reach some conclusions and for that I thank you! It's better for me to think in tandem with someone else. So thank you for sticking with me.
If you think on some other solutions... please lay them down. It is always a good thing to have more options.
|
|
|
|
|
You're welcome!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Update: This is after 5 days. I didn't do anything important these days, I believe I installed 1 or 2 software and 1 or 2 games, and I guess at least 10 restarts of PC in the last 5 days from when I installed that patch from you.
- Today I input the usb into my phone again, and for my surprise it appear on the phone "usb PC connection" and on my actual PC, in device manager the things are the same, nothing appear or dissapeared, but the content of the phone is now visible!!! Before, when I come with the problem, nothing was visible inside the folder of the phone. It was all white.
Now is back to normal.
https://i.imgur.com/mBf0r3c.jpg[^]
I have no logical explanation. It just worked. But why exactly? What is the trigger? Maybe that update was still updating my windows, after a couple of PC restarts? It's the only thing I can think. Welcome to the weirdness of windows world.
I felt responsible to bring the good news to you, because like me, you are a technical guy who likes good results. Have a good day.
|
|
|
|
|
Ah. The Development Fairies have defeated the Random Fault Gremlins ... I hate it when that happens ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
I killed the communication between my PC and my Android phone a while ago. The phone won't work with my portable, nor with my desktop. It lost them both ad the same time, so it wasn't the fault of the PC(s) - and I know how I did it:
I am not a big fan of smartphone apps. My eyes are too old, my fingers too large, and touch screens everywhere refuse to react to my fingertips - if you see someone at the coffee machine tapping, tapping harder, tapping again, ... then it could be me. Same with my baking oven. And my desktop radio. I set up my Bluetooth PC keyboard to talk to the phone, but that works at home only.
I decided to clean up my phone, so that it would have only the apps that I "must" have. Not the other hundred or so apps that somehow have made it into my phone. I killed off every one that I didn't remember ever using. Obviously, I removed one too many.
I haven't yet gotten around to fixing it, but assume that a complete 'restore to factory settings' will do the job - crossing my fingers for factory restore still being available even if OS updates no longer are. If not, I have another reason for replacing my six year old Galaxy S7 edge with several cracks in the front glass 
|
|
|
|
|
trønderen wrote: touch screens everywhere refuse to react to my fingertips
I used to have a similar problem until I realized that the cause was that I wasn't keeping my finger stationary during the tap.
If you make contact with the screen and don't keep your finger absolutely stationary, it will assume you mean to start a drag and drop operation.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I've recently experimented with base and derived forms, and though it works fine with non-resizable forms, there are problems with resizable forms.
As you know, with resizable forms, you use anchoring and docking to keep the controls in place and let the form resize gracefully. But when you inherit from a form that has anchored or docked controls, the inherited form does not display correctly in the Visual Studio Form Designer. It appears to compile and display correctly while running, but that too could break.
Obviously, in an inherited form, both constructors execute, the base form's and the derived form's. It seems the problem is that one form's constructor sets measurements while the layout is suspended in the other form's constructor. I read about this in Roland Weigelt's blog Roland Weigelt - Visual Inheritance - How to escape Layout Hell[^]
He explains that
Quote: In the moment the constructor of the base class is left, the layout and the controls are perfect for a Form1 instance - but that's not what we want. The method InitializeComponent() of class Form2 contains the code that is necessary to achieve the desired layout by tweaking the base form and adding the second button. While setting the Text property to "Form2" is rather trivial, setting the ClientSize property causes serious trouble. The problem is that the size is set while the layout logic is suspended; i.e. the size of the form is changed, but the anchored elements of the base class are not updated.
And in Roland Weigelt - Visual Inheritance Revisited[^]
Quote: Question: So why does docking work, but not anchoring?
Docking tells a control to grab as much space as possible (for top/bottom/left/right: towards to the specified direction) until a border of the container is reached. When the size of the control's container changes, the border is moving, so the docked control will resize itself accordingly.
Anchoring tells a control to keep a constant distance between a specified border (top/bottom/left/right) of the control and the corresponding border of the container at all times. Now if the container is resized while layout is suspended (which is the case in InitializeComponent() of class Form2), the anchored control does not notice the change. When layout is resumed, the control will keep the distance that exists at this time. This can be observed if you resize the form either inside the forms designer or at run time. The anchoring works perfectly, but unfortunately using the wrong offsets...
He advises to use docked panels, but I found this not to work, probably because WinForms has changed since 2003, when he wrote that article.
For now, I'm experimenting with form templates. But templates go only one way. They are basically just copies, so later revisions to the templates don't appear in the forms created from the templates.
Do you use form inheritance, and if so, how do you deal with this?
|
|
|
|
|
So, WinForms. Might helpt a bit if you include that info.
RobertSF wrote: He advises to use docked panels, but I found this not to work, probably because WinForms has changed since 2003, when he wrote that article. It didn't, but you found me in a non explaining mood.
Did you really think that WinForms would change after these years?
RobertSF wrote: Do you use form inheritance, and if so, how do you deal with this? Yes. And elegant.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|