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
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