0

I have a datatable with required data.

try
        {
            using (var connection = conn)
            {
                using (var command = conn.CreateCommand())
                {
                    command.CommandText = SqlCommand;
                    command.CommandType = CommandType.Text;
                    if (connection.State == ConnectionState.Closed)
                        connection.Open();
                    command.Connection = connection;
                    DbDataReader reader = command.ExecuteReader();
                    var dataTable = new DataTable();
                    dataTable.Load(reader);
                    if (dataTable.Rows.Count > 0)
                    {

                    }

Datatable has columns from joins. comments, commnets1, comments2, , ...comments17. Updateby, Updateby1, updatedby2, ...updatedby17 updateddate,updateddate1, updateddate2, ...updateddate17

So I need to find only the columns tat starts with "abc" and check if they are not null. How can I do this any suggestions ? Thanks for your help. I was thinking if we can create another data table with just those columns and check each column is not empty

GSR
  • 115
  • 2
  • 12

0 Answers0