Base solution for your next web application
Open Closed

Retrieve Data from a Database #5081


User avatar
0
jeddins created

I am new to developing applications using database requests. I have been trying for a while to figure out how to request data from my database. There doesn't seem to be much straight forward documentation on how to do this within the ASPNET ZERO frame work. So far I have been successful in creating my model, controller, and view, but can't figure out the data retrieval part.

I have already created a new view being displayed in the Mpa Area and just want to display some user information and that users content on my view.

Could someone please provide me with a quick tutorial or example including the DB Context, DBSet, then the model, controller and view.

I understand how ajax works, but seem to missing an important part in the other sections.

Thanks for any assistance!


5 Answer(s)
  • User Avatar
    0
    inzone created

    You can query data using Repositories. Read more: <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Repositories">https://aspnetboilerplate.com/Pages/Doc ... positories</a>

  • User Avatar
    0
    alper created
    Support Team

    hi

    You have the code of current AspNet Zero pages. So there are lots of DB queries. For example, see InvoiceAppService.cs

    <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application/MultiTenancy/Accounting/InvoiceAppService.cs#L39">https://github.com/aspnetzero/aspnet-ze ... ice.cs#L39</a>

  • User Avatar
    0
    hitaspdotnet created

    Hi, I'm a HighSchool student. I can suggest you to use DEVELOPING STEP BY STEP. Well document for all level of knowing

  • User Avatar
    0
    jeddins created

    <cite>inzone: </cite> You can query data using Repositories. Read more: <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Repositories">https://aspnetboilerplate.com/Pages/Doc ... positories</a>

    Thank you for the response. I have looked into this but, all of the examples focus on data input and output rather than just data output. As a beginner, this is really confusing. I just want to simply return values in a view from the database.

  • User Avatar
    0
    alper created
    Support Team

    it's Asp.Net basics. maybe it'd be better to follow the online Microsoft Asp.Net Training <a class="postlink" href="https://mva.microsoft.com/en-us/training-courses/asp-net-core-beginner-18153?l=VM5gy36dE_6611787171">https://mva.microsoft.com/en-us/trainin ... 6611787171</a>