Resolved Best way to assign an instance of a model to a SQL data table.

Jigabyte

New member
Joined
May 5, 2021
Messages
2
Programming Experience
10+
Hi,

I am currently learning C# so sorry if this is an easy one. I have created a model which matches a table in my SQL database. I have populated the model. How do I transfer the model to my database?

Model Customers
Table Customers.

I need to get the primary key of the new customer so I can add notes to a linked table.

Many thanks,
 
Moving to SQL section...
 
That depends. Are you using ADO.NET? Entity Framework? Some other ORM? It seems that you probably need to do some general reading on .NET data access and decide which way you're going to go, then look at the specifics of doing it that way.
 
That depends. Are you using ADO.NET? Entity Framework? Some other ORM? It seems that you probably need to do some general reading on .NET data access and decide which way you're going to go, then look at the specifics of doing it that way.
Thanks for the reply. It's a one off utility to import data from a spread sheet so I ended up using a data adapter a command builder to inject the data into my sql database.
 
Back
Top Bottom