In ASP.net

Is there a way of deleting all the rows in a table in the dataset.

In regards to deleting all the rows is there a Delete/Remove function
similar to the simple update function of an DataAdapter
i.e objDataAdapter.Update(objDataSet, "TableName")?


In relation to updating is there anyway to update into a column with spaces
in its name using the simple update function - i.e objDataAdapter.Update
(objDataSet, "TableName")

Also is there a way finding out how many rows in a dataset?

Thanks

Re: How to delete all rows in a dataSet, Update problems by Jon

Jon
Thu Aug 19 15:25:15 CDT 2004

rdt <rdt@noemail.com> wrote:
> In ASP.net
>
> Is there a way of deleting all the rows in a table in the dataset.
>
> In regards to deleting all the rows is there a Delete/Remove function
> similar to the simple update function of an DataAdapter
> i.e objDataAdapter.Update(objDataSet, "TableName")?

Use exactly the same thing, having deleted the rows from the tables -
and make sure your data adapter has a delete command.

> In relation to updating is there anyway to update into a column with spaces
> in its name using the simple update function - i.e objDataAdapter.Update
> (objDataSet, "TableName")

Yup, just make sure the command has the table name in quotes or in
square brackets or whatever your database requires.

> Also is there a way finding out how many rows in a dataset?

int total=0;
foreach (DataTable table in dataSet.Tables)
{
total += table.Rows.Count;
}

(Or something very similar - that's off the top of my head.)

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too