Problems with dataset and dataadapter

R

Rui Dias

Greetings,
Can You take a look to the following code?

SQLComando = New SqlCommand(strsql, myConnection2)

SQLComando.CommandTimeout = 45

Dim daGrid1 As SqlDataAdapter = New SqlDataAdapter

daGrid1.SelectCommand = SQLComando

myConnection2.Open()

Dim dsGrid1 As DataSet = New DataSet

daGrid1.Fill(dsGrid1, "Lista")


As you can see it is a perfect straight forward code. The sql SELECT string
is correct, and it's not placed here for space concern.
Now it comes the question. Why sometimes the fill doesn't work? Sometimes it
gives me the following error:

System.Data.SqlClient.SqlException: Invalid object name 'ASS_Processamento'.
Invalid object name 'ASS_Justificacao'. Invalid object name
'ASS_TipoJustificacao'. Invalid object name 'ASS_Justificacao'. Invalid
object name 'ASS_TipoJustificacao... ************ retirado parte da
mensagem por espaço*************

wAssiduidade.wfrmJustificar.Justificar() in
C:\Inetpub\wwwroot\wAssiduidade\wfrmJustificar.aspx.vb:line 161 Invalid
object name 'ASS_Processamento'. Invalid object name 'ASS_Justificacao'.

Invalid object name 'ASS_TipoJustificacao'. Invalid object name
'ASS_Justificacao'. Invalid object name 'ASS_TipoJustificacao'.

Am I making any sense? The table is in DB, SELECT statement has a (NOLOCK)
statement,...
Sometimes, even more rarely, the fill doesn't fills :) data. datatable comes
with no rows when it should come. they're there!

Regards,

Rui Dias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top