I have a query in Mysql like the following:
SELECT id, nome, sigla
FROM pais
WHERE (estado=@estado)
In my code without using the parameter I would simply use:
this.cidadeTableAdapter.Fill(this.anfeDataSet1.cidade);
and everything would be ok.
More using the parameter how do I put a value on the parameter and pass to the TableAdapter?
Take a look at this: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.parameters.aspx
Best option btw is to use the connection to the database so you don’t have to close it explicitly.