|
Hi Sandeep,
Did you not see my statement: Quote: fyi: I am using a custom IComparer<keyvaluepair<string, string="">> for sorting, but, that's working as expected.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Sure I missed it. Apologies.
Now, If you are using, you should not get the error. Sample I shared above is working fine for ElementAt, to which your query was related to. Is that of some help?
UPDATE:
Chuck it. It's the square and circular brackets difference between yours and my code. You already got that, so
modified 23-Nov-20 4:47am.
|
|
|
|
|
Hi Sandeep-ji, कोई बात नहीं
See Richard Deeming's post for the correct diagnosis.
thanks, Bill
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
|
SortedSet<T>[^] doesn't have a property called ElementAt .
The ElementAt[^] method is an extension method defined for all IEnumerable<T> instances. You'll need round parentheses to call it, rather than square brackets, and you'll need a using System.Linq; declaration at the top of your code file.
But in your example, it would be better to simply use a foreach loop instead. The ElementAt method has to create an enumerator and enumerate i elements of the set for each iteration of your for loop, whereas a foreach loop would only create a single enumerator and enumerate the set once.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
There's some basic performance data in the Microsoft docs for a few collection types:
Collections and Data Structures | Microsoft Docs[^]
Sorted Collection Types | Microsoft Docs[^]
But there are so many different collection classes available these days, even if you restrict yourself to the BCL, that it would be difficult to find a source to compare the performance of all of them.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I need some guidance and advice to build a questionnaire system similar to Google forms that include two parts,
the first part is a desktop system with vb.net or c# and separate SQL server database (it must be a desktop system because it will be part of a vb.net old system, The new project will be called from within the main interface of the old project )
and the second part is a web system, and the two systems are linked to one SQL server database through a local network and a local server
the desktop system builds multiple questionnaires forms and each questionnaire is associated with a specific user to answer these questions through the web system via the username that will be assigned to him by the desktop system... Here, I would like to note that each user has a different questionnaire from the other...
The desktop system will also use the answers to build a dashboard has charts and report based on the analysis of the answers
My questions ...
1- What is the best way to design (questionnaire builder) if I want it to work and similar to Google Forms method and user interface of building questions if each user has its own questionnaire that contains an unlimited set of questions, the new question is added through the Add button and each question is specified by the admin It determines the nature of the answer and the answer and contains a tool to choose a specific classification from a group of classifications that are added to the system, and each question contains in addition to the answers a field of notes and evaluation from 1 to 5, and after building this questionnaire for a specific user it is permanently saved and linked with this user and there is a possibility to edit these questions on This questionnaire for the future.
Is the User Control method the best way to build a question-building interface, or is there a better way and how?
2- What are your tips and directions that help me to build a better design for such a system?
Greetings
|
|
|
|
|
|
|
Hi all,
I'm dipping my toes into the world of Docker and thought as part of my learning curve I'd try and containerize a recent net core api project. I've written a Dockerfile which seems to build the image ok but fails when I try running it with a file not found error. Any ideas guys ? This is only the beginning as the API makes calls to a postgresql database but the Docker way seems to be layered so I thought I'd start with the API first - am I correct doing it this way ?
Docker file
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
WORKDIR /app
COPY . ./
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "MyAPI.dll"]
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
|
|
|
|
|
Did the file "not found" have a name?
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Yes my API assembly name
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
|
|
|
|
|
I suspect that your build has actually gone into the app/out folder rather than the app folder.
|
|
|
|
|
Thanks Pete what can I do to change that ?
Edit I managed to suss it I out think, well it runs
Get Base Image (Full .NET Core SDK)
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
WORKDIR /app
Copy csproj and restore
COPY *.csproj ./
RUN dotnet restore
Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
Generate runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "AllValvesAPI.dll"]
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
modified 20-Nov-20 11:08am.
|
|
|
|
|
Hi, I have a Windows app which contains some text boxes as inputs and a DGV. I can export the DGV content to Excel file. I want my app to load my previous contents in DGV automatically ,when I run the app . How can I achieve this goal? The save file should be addressed where the main EXE file exists.
|
|
|
|
|
Alex Dunlop wrote: The save file should be addressed where the main EXE file exists.
That won't work if your application is installed in the "Program Files" directory. Regular users don't have permission to write to folders in that location.
Where Should I Store My Data?[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Quote: The save file should be addressed where the main EXE file exists
No, it shouldn't.
That's a rookie mistake: it works in development but fails in production because the EXE file is stored under a subdirectory of "Program Files" and that folder is protected by default to prevent or at least reduce virus activity. So when you app truies to write a new version, it can't and you app fails. See here: Where should I store my data?[^] for some better ideas.
Actually restoring the data isn't complicated: read the Excel file and load the DGV in the Form Load or Show event. Stroe the path to the Excel data in teh EXE config file, and you can save and restore it to the same place.
But you are still using the DGV directly, instead of the underlying data which is a mistake.
As I explained last time, your DLL based "write to Excel" code needs to be passed something, and a DataTable is much better than a DGV - so add code in that assembly to read it back out and into a DataTable. Then return the DT and your EXE can use that as the source for your DGV.
It really does make life eaiser, even if it means you making small changes to existing code!
"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!
|
|
|
|
|
The problem coexists with DataTable is that I cannot change text font of cells. And because of the language I'm using (Persian), I need to perform RightToLeft function. It's so easy in DataGridView's native properties but I don't know hpw to change font, alignment, and RightToLeft properties in DataTable.
|
|
|
|
|
That's a presentation function, not data related - and should be solved separate to the data by setting the default cell style (including font) on the DGV before or after you load the data.
You are mixing this stuff up far too much: if you need to change from a DGV to different controls, that formatting will not carry with it anyway!
"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!
|
|
|
|
|
The problem coexists with DataTable is that I cannot change text font of cells. And because of the language I'm using (Persian), I need to perform RightToLeft function. It's so easy in DataGridView's native properties but I don't know hpw to change font, alignment, and RightToLeft properties in DataTable.
|
|
|
|
|
Listen to what OG is saying, treat the data and the formatting/presentation as two distinct issues. Store the underlying data set, probably as CSV in the users data folder and format the DGV using the DGV properties when loading the stored data.
DO NOT ATTEMPT TO STORE THE FORMATTING!
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I have a .NET 5 console app, which has an App.config (with EF / database connection strings in it).
It works fine, but if I publish as a single file it doesn't work, i.e. it doesn't read the app.config file..
I even specified that the App.config is not embedded in single file deploy, like so in the .csproj
<ItemGroup>
<None Update="*.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</None>
</ItemGroup>
What else could I be missing!?
|
|
|
|
|
Are you sure it's renaming the config file correctly? With that setting, it looks like the file in the output directory will be called app.config , but it needs to be called YourApp.dll.config or YourApp.exe.config .
What happens if you remove the <None> element from the project file?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
yea, yeah, once deployed, with that flag / .csproj change, it has both files, i.e. "app.config", and "<myproj>.dll.config" but fails to read any of them anyway!
|
|
|
|