views:

1146

answers:

1

hihi,

how i clear all data and not delete data or column in datagridview? i wan clear the data first and query on the result to make the result not duplicate.. can anyone help me??

A: 

I'm not sure that I understand what you asked, but yet - Clearing all rows from DataGridView is very simple:

dataGridView1.Rows.Clear();

Regarding the query duplicates, you can use SELECT DISTINCT. And another thing: I hope your code is only a simplified example, because it is highly exposed to SQL injections.

HuBeZa