A question about SQL and Lists.
Hey all,
Firstly I apologize for the stupid question, I'm still learning this and I've gotten myself confused and therefore in a mind-block. Need someone to break out the crayons...
I'm designing a sort of service board that people can use to quickly see projects we have going. It is going to connect to a ConnectWise database (read only) to get a list of our clients, techs etc.
The flow would be creating the bulletin, selecting the tech and client from a drop down list (created from the database), adding in any notes and hitting create.
I won't be importing(?) the ConnectWise database as it just makes 20 bazillion models and will be accessing it using SqlConnection. The Model I DO have is very small (6 variables, all strings except the ID) as it's all I need for the scope of this app.
What is needed is to run the SQL Query to get the techs/companies and add it to a list so they can be selected in a drop down from the View, I'm using a basic CRUD in .NET Core. My issue is that I don't know WHERE I am putting the queries and lists so that the View can even see them.
The queries are there to save the need to constantly update the techs and clients as they leave the company, and also for personal knowledge.
Hopefully I articulated myself properly, thanks for your time.
Half-Assed Rough code for adding:
string conn = "blah"; string query = "SELECT stuff"; List<string> techs = new List<string>; using (SqlConnection etc){ SqlCommand etc open using (SqlDataReader derp){ while (hasStuff) techs.Add(results); } }
0 comments:
Post a Comment