For several days now copy-paste code that does not work.
You need to get data from the server table and assign it to an object, array, or list.
Without any Entity Framwork. Just request for Sql and write the table to a variable.
Thank.
- github.com/StackExchange/Dapper - Primus Singularis
|
1 answer
You need to enable SqlClient in project.json.
"frameworks": { "netstandard1.3": { "dependencies": { "System.Data.SqlClient": "4.1.0-*" } } } Then you will be able to use the SQL connection:
using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); using (SqlCommand command = new SqlCommand("SELECT * FROM dbo.Test", con)) { var reader = command.ExecuteReader(); // map your reader } } |