16,004,507 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Christian Graus (Top 200 by date)
Christian Graus
3 days ago
View
This is a common homework question and lots of examples exist online
Christian Graus
3 days ago
View
Your date is obviously null
Christian Graus
3 days ago
View
No one can answer this. no one cares what port your localhost uses. You are too lost to get help online, ask your teacher
Christian Graus
3 days ago
View
Thisis the correct answer. You can use CSS to define what gets printed
Christian Graus
3 days ago
View
What on earth as you asking? What debugging properties? The properties of your project are in json and js files.
Christian Graus
3 days ago
View
Imagine not showing us the error message? This looks fine to me at first blush. Have you considered adding a constructor?
Christian Graus
30-Mar-23 7:37am
View
I gave a clear answer as well as pointing out it was a simple question. How many years ago???
Christian Graus
24-Jan-21 22:19pm
View
If you're making a HTTP call, you can test it there
Christian Graus
24-Jan-21 21:06pm
View
have you tried forming a call in postman?
Christian Graus
24-Jan-21 20:17pm
View
Why are you learning C in 2021?
assert(head->next->priority == 0);
This is clearly failing. why?
Christian Graus
24-Jan-21 0:26am
View
The first bit is the algorithm you're using to find a distance between two lat/lng This is then just vector maths at that point. So if your two points are 2 miles and you want to add one mile, you need the vector point that's half as long again as the vector you have
Christian Graus
23-Jan-21 20:22pm
View
What are X and Y? How do they translate to Lat/Long?
Christian Graus
23-Jan-21 3:23am
View
I get how a need for work gets you writing a client demo when you can't code. Do what you need to, to make a living, but take the time to learn programming so you end up able to have a career
Christian Graus
23-Jan-21 3:08am
View
Yeah, so you should find a beginner course and do it. You would be wise to not do PHP, which is sh*t
Christian Graus
23-Jan-21 2:44am
View
Do you mean sine? If your result is wrong, your algorithm is wrong
Christian Graus
23-Jan-21 2:43am
View
VB6 has been a dead language for 18 years now....
Christian Graus
23-Jan-21 2:41am
View
God no. I mean what I said. Call a STORED PROCEDURE that manages the process
Christian Graus
23-Jan-21 1:57am
View
so you want to make two steps. So do them in a stored proc, in a transaction, and return the result. Then it all worked, or none of it did
Christian Graus
22-Jan-21 22:29pm
View
I would guess you need to include the library you are using?
Christian Graus
22-Jan-21 16:23pm
View
Two people have given correct answers. You should try to digest them then ask based on the things you learn
Christian Graus
22-Jan-21 16:22pm
View
So this code should iterate through your collection and yes, return a 400 if the email is in it. If it's not working, I'd put that code on a new line, and debug it in Chrome.
Christian Graus
22-Jan-21 3:36am
View
Jesus.....
Christian Graus
21-Jan-21 21:59pm
View
What do you want to do? Have you set breakpoints to see what this code does?
Users is a collection and user in this function will be each user in the collection, not the user you set above
Christian Graus
21-Jan-21 20:07pm
View
Fix your code. This means a loop never ends and calls it over and over. Debug your code to see the path happening and why it recurses
Christian Graus
21-Jan-21 19:58pm
View
That seems likely to me. It's the number one reason your code would stop running instead of breaking on code that blew up
Christian Graus
21-Jan-21 19:50pm
View
You need to learn to set breakpoints and debug your code. I think you're saying the whole thing blows up. I'm going to guess that you are getting infinite recursion and your stack is blowing out. That is, you call that function over and over until the system blows up
Christian Graus
21-Jan-21 19:45pm
View
You posted a lot of code. Step through it and tell us which line blows up
Christian Graus
21-Jan-21 19:37pm
View
On the back end I think in PHP you can store a value in a session or globally. You are using Javascript in HTML, and that has a local storage store to put your values if you want them in the front end
Christian Graus
21-Jan-21 19:35pm
View
So you called refresh/False with a get, and it failed
Christian Graus
21-Jan-21 19:23pm
View
That code at least contains a URL. Are you stepping through the code? which line has the issue?
Christian Graus
21-Jan-21 19:14pm
View
The code I gave you will select JSON from the database
Christian Graus
21-Jan-21 17:16pm
View
I don't see how you can get the error. IF you do, remove all params (hard code them) then add one at a time until you work out which one is not working
Christian Graus
21-Jan-21 17:15pm
View
Happens to me all the time :)
Christian Graus
21-Jan-21 15:19pm
View
As I showed you, you can select JSON data right from the DB. Otherwise you can grab your data set and string mash JSON
Christian Graus
21-Jan-21 2:12am
View
Glad to help :)
Christian Graus
21-Jan-21 0:04am
View
I just googled and gave you a link, then realised it was useless. I thought it was an article. But if you have ascii, what form do the images take inside that? Are they missing or are they a string?
Christian Graus
20-Jan-21 21:45pm
View
Every line of C is valid C++
Christian Graus
20-Jan-21 20:52pm
View
https://www.w3schools.com/howto/howto_css_full_page.asp
This seems to be the old school way to do it
Christian Graus
20-Jan-21 20:27pm
View
Use switch statements. Use srand to seed your generator to get different results
Christian Graus
20-Jan-21 18:53pm
View
Do you want to maintain the aspect ratio?
Christian Graus
20-Jan-21 17:04pm
View
Sorry, I missed that.
Christian Graus
20-Jan-21 16:56pm
View
What's wrong with the JSON?
Christian Graus
20-Jan-21 16:42pm
View
Deleted
What you tried does not accept an array of objects. "with the new key and value added for each object" I'm not even sure what this means. An array is not a dictionary. Ask your lecturer what they are talking about.
Best guess, add the key and object to the array? This makes no sense though
Christian Graus
20-Jan-21 16:40pm
View
Deleted
This doesn't do what he asked :)
Christian Graus
20-Jan-21 16:32pm
View
Wait, you're in a website?
Christian Graus
20-Jan-21 16:32pm
View
Awesome :)
Christian Graus
20-Jan-21 15:43pm
View
So if you have the position of your image, say it's at 145, 20, and you have your mouse click position, normalised to your window, then you subtract the image position from the click location
Christian Graus
19-Jan-21 20:58pm
View
You need to catch the click and then work out where that is in the image
Christian Graus
19-Jan-21 20:56pm
View
This code is VB. SQL databases have nothing to do with C#.
Christian Graus
30-Nov-20 21:24pm
View
Holy sh*t, it's been 10 years and you're still working on this?
Christian Graus
18-May-20 1:45am
View
I reccommend reading a book on how CSS works before you go any further
Christian Graus
7-Jan-20 1:39am
View
https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.groupby?view=netframework-4.8
Christian Graus
7-Jan-20 1:22am
View
OK, well, if you're not willing to use the tools available to you, then I guess play with your LINQ statement until it returns the data you expect. If you want help, post the data, your code, and what you think is wrong in the result
Christian Graus
7-Jan-20 0:38am
View
Again, write a SQL view that groups your data the way you want it and call that....
Christian Graus
6-Jan-20 23:24pm
View
OK, so group the records in SQL, I said that to start with
Christian Graus
6-Jan-20 22:59pm
View
I just did. Azure Message Queue
Christian Graus
6-Jan-20 22:32pm
View
This makes no sense at all. It's not helpful. Why on earth are you using ASP.NET?
Your view, if you have one, is SQL. This is an ASPX file.
Christian Graus
6-Jan-20 22:31pm
View
So you don't care what the message is? I think you should consider, in 2020, using an Azure message queue
Christian Graus
6-Jan-20 21:52pm
View
Your issue is, it's not a real question. Why do you want to talk to programs in a distributed manner? What are you trying to do?
Christian Graus
6-Jan-20 18:34pm
View
Honestly, if you get an exception it will tell you in the stack trace what line has the error. IF you can't debug your code, fix it so you can
If player is null, the code to load it is not working
Christian Graus
6-Jan-20 17:47pm
View
That looks reasonable. What is going wrong?
Christian Graus
6-Jan-20 17:33pm
View
It's an adventure :)
Christian Graus
6-Jan-20 17:16pm
View
If they are on a network, why not communicate over the network? If they need to communicate, why not create a server app they all talk to?
Christian Graus
6-Jan-20 17:15pm
View
Or set breakpoints and examine it, step through again......
Christian Graus
6-Jan-20 17:14pm
View
If there's no errors, your code works!!!!!
Christian Graus
6-Jan-20 17:14pm
View
you said it. await xxxx().
Christian Graus
6-Jan-20 0:25am
View
I have no clue. Use Postman to call your api and step through it
Christian Graus
6-Jan-20 0:15am
View
So use Postman to simulate your back end call and debug it. Then make sure your code makes the right call
Christian Graus
5-Jan-20 23:05pm
View
Great, glad that worked. You should release it for other people who need it, given you're standing on another open source project
Christian Graus
5-Jan-20 22:53pm
View
This is a code dump. What is the error?
Christian Graus
5-Jan-20 22:50pm
View
See, a line number would tell me (or you if you look) what is null. Do you know how to use a debugger? Put a try catch around all this and when it catches, step through it again and see what is null
Christian Graus
5-Jan-20 20:55pm
View
Your code is not helpful. Player is obviously not null. I have no clue what is, as you don't say what line has the error
Christian Graus
5-Jan-20 16:04pm
View
It's actually 2020, good call.
Christian Graus
5-Jan-20 16:04pm
View
You should read a basic tutorial on HTML, you obviously don't have the slightest idea what you're doing yet. A button as an onclick method where you can navigate. An anchor tag has a href
Christian Graus
5-Jan-20 16:01pm
View
That response means you didn't await a call.
Christian Graus
5-Jan-20 2:08am
View
No worries :)
Christian Graus
5-Jan-20 1:59am
View
I can't make sense of this question. What is RptObject? What technologies are you using and should have tagged in your question? What happens when you try this code? What issues are you facing?
Christian Graus
5-Jan-20 1:47am
View
I don't think so. Your code is the same everywhere. So I think you have a program locking it on some machines
Christian Graus
5-Jan-20 1:07am
View
Did you do ShipXmlDocument.Close like I said?
It can't work on any computer if you have the file locked. If it works on some, it's another program keeping the file open.
https://alternativeto.net/software/wholockme/
These programs will help you work out what is locking a file
Christian Graus
5-Jan-20 0:53am
View
OK, then just close the file. GC.Collect is almost always a bad idea. IF there's no dispose, there's no issue. The only other thing is if you have the file open in Word for example while you work on the code
Christian Graus
5-Jan-20 0:47am
View
Your issue is that the file is locked. I suspect the XMlDocument class actually has it locked. IF it has a Dispose method, put it in a using block. Store the XML in a variable, close the document, then save it using the code you've just written
Christian Graus
5-Jan-20 0:36am
View
For example. if you had the XML open in another program, it would be locked. The error, not the stack trace, would help. Try writing to a file you KNOW does not exist.
Christian Graus
5-Jan-20 0:06am
View
According to docs, there's no external library involved, so it all seems odd. TBH I am expecting you to say it also doesn't work and the issue is something else, like you trying to write a protected file.
Christian Graus
4-Jan-20 21:56pm
View
I posted a fuller reply as an answer.
Clearly if your saving code blows up, the editing code is irrelevant. Why not try what I suggested instead?
Christian Graus
4-Jan-20 5:22am
View
THAT'S HIS POINT!!! Injection allows someone to delete your tables
Christian Graus
4-Jan-20 5:19am
View
There is literally no reason you need to use LINQ. You can write a stored proc and call it from LINQ, easily. IF you want to write this as LINQ, you sure can. You can't write a query this awful in LINQ that I know of. You can't do nested subqueries in LINQ because no one wants to
Christian Graus
3-Jan-20 23:42pm
View
You don't know how to write html?
https://getbootstrap.com/docs/4.0/layout/grid/
Christian Graus
3-Jan-20 23:24pm
View
This is a code dump. Which bit doesn't work?
Christian Graus
3-Jan-20 23:09pm
View
Given you made an AJAX call, why would you WANT to reload the page? Can't your call give you whatever data you need and you can populate it without a full refresh? That's what AJAX is for
Christian Graus
3-Jan-20 23:07pm
View
Going from desktop to web is a complete rewrite. It's not much better from getting a spec and writing a website. The web works completely differently. If you don't know that, you should not be doing this.
You should tag your question with the technologies you're using. ASP.NET is horrific and obsolete for a decade. Some people still use Microsoft ASP.NET MVC but any serious web dev nowadays involves a javascript library like Angular or React IMO
Christian Graus
3-Jan-20 22:37pm
View
If you're making a new app. why are you using ASP.NET? Why didn't you tag your question as ASP.NET? If you are not up to date to use a framework like Angular, you should at least be using MVC
If you want to change the control, you need to go through the code and change it to work with the new control. There are no shortcuts.
Of course, you have to change the code completely, it's a rewrite anyhow.
You can't show a message box in your back end code.
Christian Graus
3-Jan-20 22:05pm
View
Why would you use DCOM? It's 2019
Christian Graus
3-Jan-20 22:02pm
View
If it works on some computers and not others, it means that some library this code uses is not present. Can you check what versions of .NET those computers have installed (although XmlDocument was there from the start I thought)
For i = 0 To objNodeList.Count - 1
VB is pretty crap, but if you need the -1, it's very crap indeed. Are you sure?
Christian Graus
3-Jan-20 21:59pm
View
It's unclear how you think you're not using SQL when you posted SQL
Christian Graus
22-May-19 19:57pm
View
You should, every version since has been a whole lot better :)
Christian Graus
8-May-19 0:24am
View
Also, everyone wants to know what's wrong with their code. A descriptive title will attract people using what you're using. Especially useful with a language that's on the fringes like C
Christian Graus
7-May-19 22:14pm
View
No worries :) Always post the code you tried, we're trying to help but we can't see your screen
Christian Graus
7-May-19 22:09pm
View
& is a bitwise and. Not what you want. A google tells me you want the word 'and'
Christian Graus
7-May-19 22:02pm
View
Nonsense. If you wrote code that checked the range in one step, the next 'elif' will run as you'd hope. Whatever you thought you tried, you clearly need to paste it here so we can tell you what's wrong with it.
Christian Graus
7-May-19 20:29pm
View
He's just going to copy and paste now you gave him full code anyhow :)
Christian Graus
7-May-19 20:26pm
View
I think a full example would do better to ask again with a while loop if they don't enter numbers....
Christian Graus
7-May-19 20:04pm
View
Also an async method should be called with an await keyword, which requires making the method async
Christian Graus
7-May-19 19:51pm
View
Instead of posting 10000 lines, post the bit that does what you're talking about. Do you know how to use your debugger? What does 'not working' mean? Is your background code called? What does it do?
Christian Graus
7-May-19 18:39pm
View
Cheers
Christian Graus
7-May-19 17:13pm
View
Why on earth is anyone using VB6 in 2019?
Christian Graus
7-May-19 0:38am
View
I can't make it any clearer. Set a timer to increment your value hourly. Store the value you want to use in a variable, set it from that variable.
Christian Graus
6-May-19 18:22pm
View
Well, sure. MVC is built on ASP.NET, and you can host both in the one place. I know all that. I was using ASP.NET in 2001
Christian Graus
6-May-19 18:20pm
View
If you log in to Azure AD, you will get back a token. To add authentication to your endpoints, you need to pass in and verify the token in your back end code. So you do that in your C# code, not your front end code. Why are you using nodejs AND C#?
Christian Graus
6-May-19 2:47am
View
Just to add, are you REALLY using ASP.NET and not MVC?
Christian Graus
6-May-19 2:38am
View
Sounds like one method finds the default and one uses the current setting? Sounds like an interesting C# bug......
Christian Graus
6-May-19 0:38am
View
The WH? In the first instance, I am sure I saw on the same line. I figured you missed that. Given it's not there now, I assume I wasn't quite awake yet. Doesn't seem like a huge deal to me.....
Christian Graus
5-May-19 23:51pm
View
Honestly, I don't understand why people would use ASP.NET in 2019, but ASP.NET without jquery?
Christian Graus
5-May-19 23:50pm
View
Wow, that had a this morning (on the same line), I was sure of it
Christian Graus
5-May-19 18:23pm
View
No it isn't :)
Christian Graus
5-May-19 18:19pm
View
I'll be honest, I am confused as to where you're stuck.
Christian Graus
5-May-19 18:17pm
View
Your post makes no sense. You say you can't publish but report issues with a connection string. Does the connection string work in Management Studio? Can you change it or remove it and the publish works?
Christian Graus
5-May-19 18:14pm
View
Honestly, why are you learning a framework that's been obsolete for a decade? ASP.NET was pretty great in 2002, I'd never use it now. Nor does anyone else.
Code Project has been around since the 90s. I am sure if you search, it has articles on how to use a repeater. That tells me you really don't know any ASP.NET yet . This is a good time to ask yourself why you're studying this.
Christian Graus
5-May-19 2:25am
View
Why on earth are people using ASP.NET?
Christian Graus
4-May-19 22:13pm
View
So it's solved then?
Christian Graus
4-May-19 4:36am
View
Why do you think we can? Why can't you? Why are you getting upset because people told you the truth, reasonably politely?
Christian Graus
4-May-19 4:35am
View
You've been given good answers. Your behaviour is hugely anti social. That's not a smart way to find help
Christian Graus
4-May-19 4:25am
View
Dude, you've misunderstood the situation. The site doesn't have 'private' questions
Christian Graus
4-May-19 4:16am
View
you have two correct answers. It's a hash, it's not encryption. Two things you should never write for yourself
Christian Graus
4-May-19 4:11am
View
what are you logging in to? Office? What frameworks are you using, you tagged this C#, but your code is javascript
Christian Graus
4-May-19 4:09am
View
Your clone method should create a new Student instance, using the data of the current instance, and return it
That's what cloning is
Christian Graus
3-May-19 5:29am
View
good luck!!
Christian Graus
3-May-19 5:17am
View
Your code uses a C# library to use identity server. I linked to a node library to use identity server. You will need to read the docs to see how to use it
Christian Graus
3-May-19 4:51am
View
The word 'slice' does not appear on that page, either
Christian Graus
3-May-19 4:44am
View
I can't see code in your example doing a slice. I don't understand your question
Christian Graus
3-May-19 4:41am
View
A slice of an array is a section. Create a new array.
Christian Graus
3-May-19 4:19am
View
foreach(RepeaterItem rptrItems in rptrTables.Items)
{
GridView gvItems = (GridView)rptrTables.Items[0].FindControl("grdOrder");
rptrItems contains each item, but instead of using it, you read the first one in the items list, over and over
Christian Graus
3-May-19 4:05am
View
Thanks. I have an article on this site on CTEs if you need pointers
Christian Graus
3-May-19 3:56am
View
Being able to google is a vital skill for developer
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-trigger-transact-sql?view=sql-server-201711111
Christian Graus
3-May-19 3:49am
View
That's weird as hell, but then you can use a trigger to reject duplicates in the bulk insert
Christian Graus
3-May-19 3:44am
View
Excel is not a database. Where do they go?
Christian Graus
3-May-19 3:41am
View
You keep asking random questions without showing any signs of having used a debugger or tried to fix your problem. Why isn't it giving the value? What you typed isn't code. it's half SQL and half front end. Post your actual code and the errors you get
Christian Graus
3-May-19 3:39am
View
If you get an error, why not tell us what it is?
Christian Graus
3-May-19 3:39am
View
https://www.techrepublic.com/blog/microsoft-office/prevent-duplicates-when-entering-data-into-excel/
To my surprise, I googled and found this
Christian Graus
3-May-19 0:11am
View
Please use a descriptive header like 'index out of bounds exception'
Christian Graus
2-May-19 23:21pm
View
richTextBoxReceivedMsg.Text = richTextBoxReceivedMsg.Text + szData;
this looks like it does that. Is your issue some calls not being received?
Christian Graus
2-May-19 21:24pm
View
Have you stepped through the code. Sounds like you're not sending page numbers correctly?
Christian Graus
2-May-19 18:14pm
View
If you want to clone your class, you need to simply build a new class in the interface, using the values in your object. The string class Clone method has this in the docs:
The return value is not an independent copy of this instance; it is simply another view of the same data. Use the Copy or CopyTo method to create a separate String object with the same value as this instance.
Because the Clone method simply returns the existing string instance, there is little reason to call it directly.
Strings are immutable. If you change a string, a new string is created. This means that you're making a copy, in essence. Weirdly, it means string a = b more clearly creates a new copy than string a = b.Clone()
Strings are a special case in C#. I would call the Clone method because it exists and makes your intention clear.
Christian Graus
2-May-19 17:50pm
View
Of course, the m.id is not null is not needed, if none of the columns in the join match. Left join will return all the values on the left, even if they don't match the join
Christian Graus
2-May-19 17:49pm
View
You don't know how to do a join? do the two tables have any data in common? If not, you could do a left join.
select * from men m left outer join women w on m.id = w.id // can match nothing
where (m.expectations = w.expectation2 or m.age = w.age) //etc
and m.id is not null // filter out women
This will return all the men where one of the fields matches between men and women in the or statements.
It will be very slow unless all those columns are indexed, it will involve full table scans
Christian Graus
2-May-19 17:45pm
View
Oh, it's a Crystal Reports question. If CR will only show data from one datatable, why not generate one table with all the data you need?
Christian Graus
2-May-19 6:17am
View
OK, so you need to join between those two tables on those parameters then? You don't need subqueries for that. Just join the men to the women and do a join on these possibilities
Christian Graus
2-May-19 6:16am
View
https://www.codeproject.com/Questions/775654/Automatically-opening-a-drop-down-in-WPF
Like this?
Christian Graus
2-May-19 6:15am
View
I've never done PHP, it's very old and out of date. But if you know PHP, this should not be hard
Christian Graus
2-May-19 5:44am
View
PHP can template HTML, can it not? so generate the HTML dynamically, from your data.
Christian Graus
2-May-19 5:43am
View
I can't even read this. lose the aliases when you ask english speakers for help. I'm in admiration of your bilingual skills, but they don't help me read it. Also format it better. But I'd need to know the data format to try to write a query that would work. Try explaining to me what you think the subqueries will do
Christian Graus
2-May-19 4:51am
View
var times = prayTimes.getTimes(new Date(), [43, -80], -5);
document.write('Sunrise : '+ times.sunrise)
This will return all the values it calculates. Do you want to calculate something not there?
Christian Graus
2-May-19 4:48am
View
This is a bad design
https://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_2097.htm
Christian Graus
2-May-19 4:47am
View
I never said to change a button. I don't know how to ask more clearly
Christian Graus
2-May-19 4:47am
View
That's a shame. You will learn verbose methods you will never use again. But then, no one uses ASP.NET, so nothing you're learning is terribly useful, I'm sorry
Christian Graus
2-May-19 4:35am
View
Are you allowed to use jQuery? Get an event on the drop box selection changing, read it, and I'd create a placeholder for each group of controls, so you can show and hide them in groups.
Christian Graus
2-May-19 4:34am
View
Perhaps. I don't care about the scoring system TBH. I was mostly concerned someone was giving bad advice that seemed to be getting followed.
Christian Graus
2-May-19 4:29am
View
Try using group by? Then you can use max, if the values are all the same (or min)
Christian Graus
2-May-19 4:24am
View
I don't know how to make it simpler. Do you have a PDF file you can load in the browser and it shows what you want?
Christian Graus
2-May-19 4:06am
View
God know why you think I said that....
Christian Graus
2-May-19 4:06am
View
please, please, read the link I posted, don't accept a wrong answer just because it seems to work
Christian Graus
2-May-19 4:05am
View
I didn't downvote you, moron. I just pointed out you were wrong. Any program using your solution is easily hacked and the DB easily destroyed. Read the link I posted.
Christian Graus
2-May-19 1:13am
View
A syntax checker online said this code is valid. Where is the error?
Christian Graus
1-May-19 21:28pm
View
A dataset is a class that exists to contain more than one table. That's easy to do.
https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/dataset-datatable-dataview/adding-a-datatable-to-a-dataset
Christian Graus
1-May-19 21:00pm
View
Good luck :)
Christian Graus
1-May-19 20:40pm
View
No worries. These frameworks have so many bits, learning some basic razor first is not a terrible idea, but you've moved to a level of complexity where some of your code needs to live in a C# class
Christian Graus
1-May-19 20:36pm
View
You're going backwards. You're doing it the hard way. Use MVC, learn how to use Razor in sensible ways, and don't learn how to use it to do things no one does :)
If your connection class has a Close method, you would call it :) Ideally, if it's IDisposable, you'd use it in a using statement
Christian Graus
1-May-19 20:26pm
View
Oh, you're doing everything in the CSHTML? That's pretty messy. You have no C# classes? Why would you do it this way?
Yes, if you're creating an old school, 2006 DB connection, it won't close if you don't close it.
Christian Graus
1-May-19 20:20pm
View
Are you using entity framework? You could be. If not, what are you using for a DB connection?
Christian Graus
1-May-19 19:28pm
View
Glad to help. A slow work day meant I had time to download the code and dig into it
Christian Graus
1-May-19 19:18pm
View
Yeah, so in the end, your selected index changed event didn't deal with the box being deselected, it assumed there was always a selection. Your code also blows up if you add a student with no scores, your edge case handling needs work
Christian Graus
1-May-19 19:00pm
View
if (_selectedIndex > -1){
Student student = GetStudent(_selectedIndex); //select index from list
....
}
Christian Graus
1-May-19 18:50pm
View
I see now. Try adding code that checks if the selected index is -1 and not proceeding if it is.
Christian Graus
1-May-19 18:41pm
View
You've stored it, but you didn't use it on the other end!!!
Christian Graus
1-May-19 18:32pm
View
But you want one value for each key1, either the null value or a value that's not null? Or are you saying there could be lots of key2 values and you want them all, or just the null value if it's all that exists?
Christian Graus
1-May-19 18:28pm
View
Replace students.SelectedIndex with _selectedIndex, the variable we created. If that call is in another form, then you can create a new method in the base form that assumes _selectedIndex is the index you want.
Christian Graus
1-May-19 18:26pm
View
students is your listbox. The SelectedIndex is -1. That's why we stored it in a variable
Christian Graus
1-May-19 18:06pm
View
Learn to use the debugger. You're getting the same error because you're still looking up the index from the control and not your variable. The debugger will show you this if you look. Look at the call stack and see the method that called the method that blew up.
Christian Graus
1-May-19 17:52pm
View
This is a different form. Don't post an entire class, if you think you did something, show me the snippet. I am running your code, I see where it's blowing up and why
Christian Graus
1-May-19 17:41pm
View
private int _selectedIndex;
private void students_SelectedIndexChanged_1(object sender, EventArgs e)
{
_selectedIndex = students.SelectedIndex;
Now replace students.SelectedIndex with your new local variable
Christian Graus
1-May-19 17:27pm
View
-1 is always an invalid value. -1 means nothing is selected. Your listbox doesn't have a selection by the time you call this. It's just how the UI is behaving. You need to store the index in a local variable when the selection changes, and use that value for your index
Christian Graus
1-May-19 17:16pm
View
And learn how to use your debugger. I ran it, it blew up, I looked on the call stack, checked the value and saw the issue
Christian Graus
1-May-19 17:16pm
View
It's exactly what I said
Student student = GetStudent(students.SelectedIndex); //select index from list
students.SelectedIndex is -1. I thought it might be. It's the index of the listbox. Store that in a variable when you start your edit, because it's being deselected when your new dialog appears.
Christian Graus
1-May-19 17:10pm
View
The index is an integer you entered? how can that work? It's an index into an array, it should be the index of the item you're editing, passed in from the parent form
Christian Graus
1-May-19 16:54pm
View
yeah, that's what I would have said if the question had been clearer :)
Christian Graus
1-May-19 16:53pm
View
If the value is in your model, why are you calculating it? I assume modelItem is coming from a foreach on the model?
Christian Graus
1-May-19 16:51pm
View
Depends on the language you use.
Christian Graus
1-May-19 6:11am
View
The example has a sum. Replace it with Max.
Christian Graus
1-May-19 2:17am
View
If it's a COM object, you can spin it up in most languages and call it.
Christian Graus
1-May-19 1:52am
View
I would suggest writing a simple page to work out what events work on your tablet
Christian Graus
29-Apr-19 4:22am
View
Can you give us a name or a URL? Your issue is with a library. My work day is slow enough that I'd look at it if you told me which one
Christian Graus
29-Apr-19 4:19am
View
That doesn't help. You get a user id, write an API that takes it and returns data
Christian Graus
29-Apr-19 3:02am
View
Write code. Actual code. It's unclear what's in your XML document, but I assume the ID of a user to get from a database? Try writing code and asking specific questions when you get stuck after trying to do it yourself
Christian Graus
29-Apr-19 2:24am
View
That was the point here. he was given a function that did nothing and asked to make it work
Christian Graus
29-Apr-19 2:07am
View
If they wrote the tool, a bug in the tool is not an impossible problem to have
Christian Graus
29-Apr-19 2:05am
View
Nothing. It's doing exactly what they asked. The return statement is superfluous, you could remove it. That's the only improvement I see
Christian Graus
29-Apr-19 2:02am
View
What is a 'sanity check error'?
Christian Graus
29-Apr-19 1:59am
View
This will do nothing. It increments a local variable and returns. If you make it a ref, then it will pass by reference and increment the variable in the calling code
You could also pass in a pointer and get the same result. You'd have to dereference the pointer to increment it though.
Christian Graus
29-Apr-19 1:52am
View
This code should not give an error. If you pass by reference, then x will be incremented in the calling code. If you changed it and got an error, give us the new code and the error if you're stuck
Christian Graus
29-Apr-19 1:49am
View
Break your code down into steps. Make each step work. Step through and see, does the first pull get the filtered data? Why do you need to ask for data twice?
Christian Graus
29-Apr-19 1:47am
View
What library is providing this control?
Show More