Deleting all data rows

I’m trying to delete all the data rows of a table but I keep running into an internal scripting error:

Here’s my code:

tell window "mainWin"
    tell data source of table view "theTable" of scroll view "theTableScroll"
	delete data rows
    end tell
end tell

This clears out all the rows but then the app quits with the internal scripting error

tell window “mainWin”
tell data source of table view “theTable” of scroll view “theTableScroll”
delete every data row
end tell
end tell

try changing “delete data rows” to “delete every data row”