Re: datagridview question
Test the return value of FillByLastName. If it's zero then there are no matches, so you can either not bind the DataTable to the grid, unbind it if its already (DataSource = Nothing) and Clear the Columns of the grid if necessary.
Re: datagridview question
i've tested the return value of fillByLastName but my problem is i'm not writing my own data access code. i'm using datasources. is there a way to unbind it if necessary and have it bound otherwise? i hope that makes since.
another question? i'm rather new to vb programming, etc. do most programmers write their own code when it comes to accessing data or do they use datasources?
Re: datagridview question
If you don't necessarily want the DataTable bound then you shouldn't be binding it in the designer. Clear the DataSource property of your DataGridView in the designer so there's no automatic binding. You can then set the DataSource of the grid in code, if and only if there's data to display.