MSev Posted April 3, 2012 at 06:55 PM Report Share #447329 Posted April 3, 2012 at 06:55 PM public DataTable ComandoDataAdpter(string comando) { SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(comando, sql()); DataTable dtResult = new DataTable(); SQLDataAdapter.Fill(dtResult); return dtResult; } Não funciona em asp, gostaria de ter uma solução para isto! SFF o sql() é o que chama a ligação da BD, está certo! Este pedaço de código funciona perfeitamente em programas, mas na web não! Compiler Error Message: CS1061: 'AEESGTS.SQL' does not contain a definition for 'ComandoDataAdapter' and no extension method 'ComandoDataAdapter' accepting a first argument of type 'AEESGTS.SQL' could be found (are you missing a using directive or an assembly reference?) Link to comment Share on other sites More sharing options...
bruno1234 Posted April 3, 2012 at 07:46 PM Report Share #447335 Posted April 3, 2012 at 07:46 PM Onde estás a chamar esse método? Matraquilhos para Android. Gratuito na Play Store. https://play.google.com/store/apps/details?id=pt.bca.matraquilhos Link to comment Share on other sites More sharing options...
MSev Posted April 3, 2012 at 07:51 PM Author Report Share #447337 Posted April 3, 2012 at 07:51 PM foreach (DataRow item in com.ComandoDataAdapter("select * from table where nome='"+ nome.Text +"';").Rows) Link to comment Share on other sites More sharing options...
petvetbr Posted April 3, 2012 at 07:53 PM Report Share #447338 Posted April 3, 2012 at 07:53 PM Eu ia perguntar a mesma coisa, pois o que ele está reclamando é que não está encontrando o método ComandoDataAdapter onde você está chamando o método. Veja se este método está no lugar certo. Fernando Lage Bastos - MCP/MCTS/MCPD Link to comment Share on other sites More sharing options...
MSev Posted April 3, 2012 at 07:56 PM Author Report Share #447339 Posted April 3, 2012 at 07:56 PM tipo tou a chamar com esse foreach, mas noutra classe! Sim ele tá no sitio certo! Link to comment Share on other sites More sharing options...
bruno1234 Posted April 3, 2012 at 08:58 PM Report Share #447359 Posted April 3, 2012 at 08:58 PM De acordo com a mensagem de erro não parece que esteja no sitio certo. Matraquilhos para Android. Gratuito na Play Store. https://play.google.com/store/apps/details?id=pt.bca.matraquilhos Link to comment Share on other sites More sharing options...
MSev Posted April 3, 2012 at 09:05 PM Author Report Share #447360 Posted April 3, 2012 at 09:05 PM ta resolvido! mudei o nome do método! xD apesar de estar correcto nos dois lados ele não o aceitava! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now