Skip to main content
deleted 103 characters in body; edited title
Source Link
marc_s
  • 759.9k
  • 186
  • 1.4k
  • 1.5k

How do I populate SQLite-net DBdatabase with a base set of data?

I am very new to all of this (coding in general, C#, .NET MAUI, MVVM practices, SQLite) so excuse me if my inexperience shows.

The context:

The context

I gothave an app that has a database with a table (let's call it "Cars")Cars.

To make it easier for the user, I want to create page where they can create records for said table. One of the options would be to choose a brand for the car type they're trying to add. I wish to accomplish this by giving them a dropdown (which is linked to a table called "Brands"Brands).

I want the "Brands"Brands table to contain a default set of records BUT also give users the option to add more.

The question:

Question

How do I populate that "Brands"Brands table with a default set of records? Are there better ways to achieve this besides using a table?

The result:

The result

A "Brands"Brands table containing a default set of records which can also be expanded by the user.

What am I using:

What am I using

I am using Visual Studio 2022, with SQLite-net (https://github.com/praeclarum/sqlite-net) and .NET MAUI.

Should I use a different method? Do I populate the table via the class "Brands" Brands (which the table is based on)? Which seems inefficient (for this purpose) since itsit's static so you'd have to redeploy to make changes right?

Please do let me know if you need more information.

How do I populate SQLite-net DB with a base set of data?

I am very new to all of this (coding in general, C#, .NET MAUI, MVVM practices, SQLite) so excuse me if my inexperience shows.

The context:

I got an app that has a database with a table (let's call it "Cars").

To make it easier for the user, I want to create page where they can create records for said table. One of the options would be to choose a brand for the car type they're trying to add. I wish to accomplish this by giving them a dropdown (which is linked to a table called "Brands").

I want the "Brands" table to contain a default set of records BUT also give users the option to add more.

The question:

How do I populate that "Brands" table with a default set of records? Are there better ways to achieve this besides using a table?

The result:

A "Brands" table containing a default set of records which can also be expanded by the user.

What am I using:

I am using Visual Studio 2022, with SQLite-net (https://github.com/praeclarum/sqlite-net) and .NET MAUI.

Should I use a different method? Do I populate the table via the class "Brands" (which the table is based on)? Which seems inefficient (for this purpose) since its static so you'd have to redeploy to make changes right?

Please do let me know if you need more information.

How do I populate SQLite-net database with a base set of data?

I am very new to all of this (coding in general, C#, .NET MAUI, MVVM practices, SQLite) so excuse me if my inexperience shows.

The context

I have an app that has a database with a table Cars.

To make it easier for the user, I want to create page where they can create records for said table. One of the options would be to choose a brand for the car type they're trying to add. I wish to accomplish this by giving them a dropdown (which is linked to a table Brands).

I want the Brands table to contain a default set of records BUT also give users the option to add more.

Question

How do I populate that Brands table with a default set of records? Are there better ways to achieve this besides using a table?

The result

A Brands table containing a default set of records which can also be expanded by the user.

What am I using

I am using Visual Studio 2022, with SQLite-net (https://github.com/praeclarum/sqlite-net) and .NET MAUI.

Should I use a different method? Do I populate the table via the class Brands (which the table is based on)? Which seems inefficient (for this purpose) since it's static so you'd have to redeploy to make changes right?

Please do let me know if you need more information.

Source Link

How do I populate SQLite-net DB with a base set of data?

I am very new to all of this (coding in general, C#, .NET MAUI, MVVM practices, SQLite) so excuse me if my inexperience shows.

The context:

I got an app that has a database with a table (let's call it "Cars").

To make it easier for the user, I want to create page where they can create records for said table. One of the options would be to choose a brand for the car type they're trying to add. I wish to accomplish this by giving them a dropdown (which is linked to a table called "Brands").

I want the "Brands" table to contain a default set of records BUT also give users the option to add more.

The question:

How do I populate that "Brands" table with a default set of records? Are there better ways to achieve this besides using a table?

The result:

A "Brands" table containing a default set of records which can also be expanded by the user.

What am I using:

I am using Visual Studio 2022, with SQLite-net (https://github.com/praeclarum/sqlite-net) and .NET MAUI.

Should I use a different method? Do I populate the table via the class "Brands" (which the table is based on)? Which seems inefficient (for this purpose) since its static so you'd have to redeploy to make changes right?

Please do let me know if you need more information.