❔ Help with connecting API to visual studio
I was following a video I saw on youtube but now I'm lost. I need to connect to an API and extract information based on what a user selects in my windows forms that I have created. I have done some C# before but feel this is out of my league and it's for a school project.
23 Replies
1.) Don't follow youtube tutorials, or you'll be stuck in tutorial hell.
2.) Please post more information, such as the code
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient
just use http client
It has multiple classes in it since that's what I was following but not sure I need that many classes.
I am using http client somewhere in my code but I am using an API key also and then got stuck in my loop of hell. Then found this discord hoping I could get some help
show us your code
and the error you have
Is there a way to upload a file somewhere? I don't have an error yet since I'm stuck on the last part of sending the information to my other code, I think. It's been a long day.
with this
I was looking at that. I'm copying all my different classes into the code now.
you can add multiple files
there is tab above you can add
omg. didn't see that. let me go move it around lol
https://paste.mod.gg/ Does this show my code now?
BlazeBin
A tool for sharing your source code with the world!
no
did you hit save ?
Yes I did hit save.
the url should have changed to something like that
https://paste.mod.gg/bulddfqaxfgs/0
BlazeBin - bulddfqaxfgs
A tool for sharing your source code with the world!
https://paste.mod.gg/nprjygltfole/4 oops I think I copied the url before I hit save
BlazeBin - nprjygltfole
A tool for sharing your source code with the world!
Sorry I'm still super new to programming.
that should be fine
what's the issue ?
Under WorkoutPlan, I have the last part where I need to insert the datasource into my listbox on my form. lstBoxWorkoutList is the name of my list box and not sure how to grab the information that the video was talking about. The video was grabbing an image and I'm grabbing text.
And I wasn't sure if my code would work
what the type of lstBoxWorkoutList ?
It's just a listbox that I placed on the form. I'm not sure what else I could use to display the data.
I think I might have found the problem on why it doesn't show the datasource. In the WorkoutPlan for the async Task LoadWorkoutPlan, I need to get the muscle group that was selected in the SelectArea class.
I don't think I set the variable right in SelectArea called MuscleSelection. I need that variable to be in the WorkoutPlan.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.No i didn’t get my code to work.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.