• Register now to get access to thousands of Tutorials, Leaked content, Hot NSFW and much more. Join us as we build and grow the community.

Advertise Here

Advertise Here

Advertise Here

Simple Product Database in C#.NET

felon

Social Engagement Booster
F Rep
0
0
0
Rep
0
F Vouches
0
0
0
Vouches
0
Posts
113
Likes
174
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 2 900 XP
If you are looking for a Simple Product Databases you are at the right place to deal with it. This tutorial will help you how to create a simple database in C#. This projects creates a list of data such as product name and product price. I have a sample code below.

Sample Code

Product Database Script
  1. using System;
  2. using System.Collections

    .Generic

    ;
  3. using System.Linq

    ;
  4. using System.Text

    ;

  5. public class SimpleProductDatabase
  6. {
  7. public static

    void

    Main(

    )
  8. {
  9. List<

    string>

    list =

    new List<

    string>

    (

    )

    ;
  10. list.Add

    (

    "Pizza Republic: P500"

    )

    ;
  11. list.Add

    (

    "Greenoz Pizza: P500"

    )

    ;
  12. list.Add

    (

    "Shakey's Pizza: P500"

    )

    ;
  13. list.Add

    (

    "Greenwhich Pizza: P500"

    )

    ;
  14. list.Add

    (

    "Yellow Cab Pizza: P500"

    )

    ;
  15. for

    (

    int

    n =

    0

    ;

    n <

    list.Count

    ;

    n++

    )
  16. {
  17. string[

    ]

    substring =

    list[

    n]

    .Split

    (

    ':'

    )

    ;
  18. for

    (

    int

    x =

    0

    ;

    x <

    substring.Length

    -

    1

    ;

    x++

    )
  19. {
  20. Console.WriteLine

    (

    "Product Name : "

    +

    substring[

    0

    ]

    +

    "Price - "

    +

    substring[

    1

    ]

    )

    ;
  21. }
  22. }
  23. }
  24. }

For the Project.json
  1. {
  2. "version"

    :

    "1.0.0-*"

    ,
  3. "buildOptions"

    :

    {
  4. "emitEntryPoint"

    :

    true
  5. }

    ,
  6. "dependencies"

    :

    {
  7. "Microsoft.NETCore.App"

    :

    {
  8. "version"

    :

    "1.0.0-rc2-3002702"
  9. }
  10. }

    ,
  11. "frameworks"

    :

    {
  12. "netcoreapp1.0"

    :

    {
  13. "imports"

    :

    "dnxcore50"
  14. }
  15. }

    ,
  16. "runtimes"

    :

    {
  17. "win7-x86"

    :

    {

    }
  18. }
  19. }

sasa.jpg


Hope that this tutorial will help you a lot and thanks for reading this tutorial.
Don't forget to Like & Share This site www.sourcecodester.com


Download
You must upgrade your account or reply in the thread to view the hidden content.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

452,499

350,639

350,649

Top