System.Data.DataTable.Clear C# (CSharp) Method

Clear() public method

Clears the table of all data.
public Clear ( ) : void
return void
        public void Clear() => Clear(true);

Same methods

DataTable::Clear ( bool clearAll ) : void

Usage Example

Example #1
1
        public void DajPonudu(DataTable ponuda, Int32 ponuda_ID)
        {
            SqlConnection _konekcijaSqlConnection = new SqlConnection();
            using (_konekcijaSqlConnection = Konekcija.DajKonekciju())
            {
                SqlDataAdapter _dajPonuduSQLDataAdapter = new SqlDataAdapter();
                SqlCommand _dajPoslednjuPonuduSqlCommand = new SqlCommand("SELECT  * FROM  vwPonudaZaglavlje where Ponuda_ID = " + ponuda_ID, _konekcijaSqlConnection);

                _dajPonuduSQLDataAdapter.SelectCommand = _dajPoslednjuPonuduSqlCommand;

                //isprazni tabelu
                ponuda.Clear();

                try
                {
                    //napuni tabelu 
                    _dajPonuduSQLDataAdapter.Fill(ponuda);
                }
                catch (Exception)
                {
                    throw;
                }
            }

        }
All Usage Examples Of System.Data.DataTable::Clear
DataTable