|
|
jschell wrote: You can use interfaces for circular references. I learn something new every time I visit this website!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
difficulties gives us new challenges and something new to learn.
|
|
|
|
|
Hi,
I have downloaded Visual Studio to write and run C# scripts.
Can I use Microsoft SQL Manager for free to use with C# to create windows database apps?
Or do you suggest another free DB to use? or even another app to run C#?
Basically I want to get my Grand Daughter into programming using C# for, well FREE
Any suggestions and code examples greatly appreciated.
Thanks
|
|
|
|
|
|
Thank you for the quick response, really appreciated
|
|
|
|
|
You're welcome! Good luck with the granddaughter - teaching isn't as easy as some people think ...
"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!
|
|
|
|
|
|
Excellent, Thank you very much
|
|
|
|
|
Note that the current revision (1.1) of the book is more than 17 years old. Don't expect it to cover all the new bells & whistles. A few things have been added since C# version 2.0 and dotNet 3.0, so don't expect to learn enough to understand all the sample code you'll find on the internet today.
Do read the book - Petzold is a top notch technical writer, and most certainly for beginners. Just be prepared to discover that there is a lot more to C#/dotNet today that Petzold couldn't possibly have described in his 2006-2007 book.
Additional comment: Once you are through Petzold, a nice way to learn about more recent additions is to read The history of C#[^] bottom up. The links to the descriptions of each new extension is mostly quite readable!
Religious freedom is the freedom to say that two plus two make five.
|
|
|
|
|
I don't think you meant this message for me.
|
|
|
|
|
It was meant as an extension to your message, an additional comment.
I wasn't prepared for anyone having problems understanding that. In meatspace discussions, I am used to discussion participants expand on each other's contributions, directed to all listeners, not just to the one making the statement expanded upon. I frequently consider network discussions in a similar way: A post is not meant for one specific listener, but for all participants taking part in the discussion.
I'm really sorry for creating this highly undesirable situation; I hope you do not feel terribly offended. That certainly wasn't my intention. I will try to remember in the future that if I add to something that you say, I will not do it as a followup to your post, but wait until someone else makes a followup to your post and rather add my addition to that post, rather than to yours.
Religious freedom is the freedom to say that two plus two make five.
|
|
|
|
|
Sorry, I did not mean to offend you. And your comments are all valid, but I just thought that they would be best posted to the OP, as follow up to what I suggested. Experience (here) tells me that not everyone reads every message in a thread; even though you and I would seem to.
|
|
|
|
|
I retired from a career as a programmer, systems analyst, and SQL Server developer a couple years ago, but had very little experience with C#. Since there is so much info on programming available on the web (thank you Code Project and Stack Overflow), I almost never buy a book on programming. However, I did buy this one and found it valuable:
Head First C# by Andrew Stellman and Jennifer Greene (Don't know them, have nothing to gain by this plug). I have the 4th Ed, there's a 5th coming out in August. I got the PDF version for the publisher's site, but print and kindle are available at Amazon.
After information is presented, they use different kinds of non-conventional exercises designed to help understanding and recall. There are various places on the web where you can preview some chapters and see how they do it.
It is aimed at young programmers just coming up, rather than old farts like me, and may appeal to your granddaughter.
|
|
|
|
|
I'm trying the C# example here:
Changing the Bluetooth Radio Mode | Microsoft Learn
It's referencing BthUtil.dll. I can't find this DLL anywhere. How can I find this?
Thanks
In theory, theory and practice are the same. But in practice, they never are.”
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
|
|
|
|
|
Look at the date on the article. It's from 14 years ago and really doesn't apply today.
From what I can tell, BthUtil.dll was part of Windows CE/Mobile, which doesn't exist anymore. It was never part of full-blooded Windows.
You're looking at an article for Windows Mobile!
|
|
|
|
|
I'm not sure that even if you find it, it would be any use to you - BthUtil.dll is part of the Windows Mobile (WM) API which was a derivative of WinCE and which finally died the death back in 2013 - it ran on relatively short lived hardware that certainly isn't being made these days and MS ended support for it back in 2019.
If you are targeting WM deliberately in 2024 then you have to ask yourself "why am I doing this?" as it's going to get increasingly hard to find hardware it will still run on that works!
If you are trying to get something working and didn't realize it was a WM app example you were following then that's your problem, right 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!
|
|
|
|
|
Do these links help?
/ravi
|
|
|
|
|
Hi
I am trying to use Parallel.ForEach with ConcurrentBag and it work but to display a feedback I used progessbar control to display fname value , problem after few seconds I get error and the error message is not visible instead a wight box appear because of using a thread . any idea what is the problem in this code ?
int row_idx = 1;
ConcurrentBag<(int, string, float)> bag = new ConcurrentBag<(int, string, float)>();
Parallel.ForEach(elements, element =>
{
string fname = element.name;
float ftrack = (float)(element.track);
var elementsToAdd = new (int, string, float)[]
{
(row_idx, fname, fsize)
};
bag.Add(elementsToAdd[0]);
row_idx++;
ProgressBar1.Text = fname;
ProgressBar1.Update();
});
|
|
|
|
|
That's because you cannot touch a UI control from anything other than the UI (startup) thread. When you use tasks, you're using other threads that are not the UI thread.
To change the text of a control, you have to marshal a call to a function back to the UI thread so that function updates the Text property and does it on the correct thread.
You can see how it's done at How to make thread-safe calls to controls - Windows Forms .NET | Microsoft Learn[^]
|
|
|
|
|
|
Hello everyone,
I'm currently working on a C# project that processes a large dataset. While my code works correctly, it's running slower than expected, especially with bigger files. I'm looking for advice on optimizing the performance.
Here’s a brief overview:
-I'm reading data from a CSV file.
-Processing involves several nested loops and string manipulations.
-Writing results to a new file.
I've tried using Parallel.For for the loops but it didn't improve much. I suspect the string operations might be the bottleneck. Does anyone have suggestions on more efficient data handling or alternative approaches for processing large datasets in C# ? Any tips on using memory more efficiently or reducing execution time would be greatly appreciated.
Thank you in advance for your help.
Best regards,
Steve
tensorflow
modified 6-Jun-24 2:06am.
|
|
|
|
|
off to the C# forum you go
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Aside from posting your question in the correct forum - did you somehow miss the repeated "no programming questions" warnings at the top of the page? - the only thing we can suggest based on such a vague description is that you profile your code to find out where the actual bottleneck is.
Anything else is going to be a wild stab in the dark, with very little chance of success.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Profile.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|