0

I need to make the select SQL Server. But the result must be displayed in the array, as it is an email marketing html.

What is the best way to display this select information within the result.

            sqlConn     = (System.Data.SqlClient.SqlConnection)cm.AcquireConnection(null);
            sqlComm     = new System.Data.SqlClient.SqlCommand("SELECT NAMEPRODUCTS, QTD, PRICE, STATUS_PROD FROM PRODUCTS", sqlConn);
            sqlDados    = sqlComm.ExecuteReader();

            while (sqlDados.Read())
            {
                //WHAT TO DO HERE ?

            }
            return "TITLE EMAIL MARKETING</h1> <br> TABLE HTML WITH RESULT SQL SERVER - HOW TO DISPLAY INFORMATION IN THIS RESULT";
  • create a class for the result and in array of that class append elements. – Amit Verma Jul 11 '21 at 02:44
  • How much do you understand about C#? About HTML email? About ADO.NET? Who are you using to send the email? – mjwills Jul 11 '21 at 02:54
  • Read this : https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/retrieving-data-using-a-datareader Or read the result as DataTable and then check this answer as well : https://stackoverflow.com/questions/19682996/datatable-to-html-table – Ram Kumaran Jul 11 '21 at 02:54
  • You ca insert your data to List or DataTable or dataset and then you can view them in a grid or table. – گلی Jul 11 '21 at 03:52

0 Answers0