AFrei Posted September 30, 2009 at 03:02 PM Report Share #289335 Posted September 30, 2009 at 03:02 PM Boas, Gostaria de limitar os registos que aparecem no datagridview. Penso que o máximo por defeito são 1000. O datagridview mostra dados de uma tabela access: Originalmente tenho Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select * from Table1 ", myConnection) Pensei que da maneira abaixo funcionasse mas não. Estava a tentar mostrar os records que tenham apenas no campo data o valor 29-09-2009. Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select * from Table1 where Table1.Data = 29-09-2009", myConnection) Alguma ideia? Obg. Ana Link to comment Share on other sites More sharing options...
fLaSh_PT Posted September 30, 2009 at 04:27 PM Report Share #289348 Posted September 30, 2009 at 04:27 PM Podes utilizar a syntax SELECT TOP() SELECT TOP (1000) * FROM registos Compr. Making the impossible possible and pwing the world on db at a time. Link to comment Share on other sites More sharing options...
AFrei Posted October 1, 2009 at 08:26 AM Author Report Share #289471 Posted October 1, 2009 at 08:26 AM Bom dia, Obrigado pela ajuda. Tentei dessa forma mas tenho o seguinte erro na linha de código da.Fill(ds, "table1") A instrução SELECT inclui uma palavra ou um argumento reservado que falta ou não foi introduzido correctamente ou a pontuação não está correcta. [/ Tenho isto na Public Class Form1 Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select TOP (50)* from Table1", myConnection) Tenho isto no Form1Load, onde aparece o erro da.Fill(ds, "table1") Alguma ideia? Obrigado Link to comment Share on other sites More sharing options...
AFrei Posted October 1, 2009 at 08:29 AM Author Report Share #289472 Posted October 1, 2009 at 08:29 AM Resolvido, bastava tirar os () e colocar apenas o número! Obrigado fLaSh_PT! 🙂 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