MSev Posted April 3, 2012 Report Share Posted April 3, 2012 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 Report Share Posted April 3, 2012 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 Author Report Share Posted April 3, 2012 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 Report Share Posted April 3, 2012 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 Author Report Share Posted April 3, 2012 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 Report Share Posted April 3, 2012 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 Author Report Share Posted April 3, 2012 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