Hello
I have been for the last 2 days for abnormal behavior
when try to refresh a datagrid from another form.
If Not (fenc Is Nothing) Then
'' Actualiza a datagrid2 do formenc
fenc.SqlDataAdapter4.SelectCommand.CommandType =
CommandType.Text
If Not fenc.RadioButton1.Checked Then
'' encomenda externa
fenc.SqlDataAdapter4.SelectCommand.CommandText = "select
artenc.pos , artenc.quant , artenc.codigo ,
familias.desfam , artigos.desart , artenc.nvias ,
artenc.id , artenc.punit , artenc.prev ,artenc.penc ,
artenc.zona , artenc.cor , artenc.prazo ,
artenc.refcliente ,
artenc.quant_exp ,artenc.nenc ,artenc.obra ,artenc.posobra
, estados.nome ,
artenc.desconto ,artenc.idcli ,artenc.obs_com ,
artenc.obs , artenc.obs_com2 ,artenc.margem ,artenc.tipo
from artigos, familias, artenc, estados where
artigos.cf=familias.cf and artigos.cf = convert
(int,substring(artenc.codigo,1,charindex
('.',artenc.codigo)-1)) and artigos.ca = convert
(int,substring(artenc.codigo,charindex('.',artenc. codigo)
+1,2)) and artenc.numenc = '" & fenc.TextBox1.Text & "'
and estados.codigo = artenc.estado order by artenc.pos
asc"
Else
'' fornecimento de material
fenc.SqlDataAdapter4.SelectCommand.CommandText = "select
artenc.pos Pos, artenc.quant Qtd, artenc.codigo Cod,
familias.desfam Familia, armazem.designacao Artigo,
artenc.nvias Vias, artenc.id Id, artenc.punit PCliente,
artenc.prev PEnc,artenc.penc PTab, artenc.zona Zona,
artenc.cor Cor, artenc.prazo Pz, artenc.refcliente
RfCliente, artenc.quant_exp QtExp,artenc.nenc
NEnc,artenc.obra Obra,artenc.posobra PosObra,
estados.nome Estado, artenc.desconto
Desconto,artenc.idcli IdCliente,artenc.obs_com ObsCom,
artenc.obs Obs, artenc.obs_com2 ObsCom2 ,artenc.margem
Margem,artenc.tipo Garantia from artigos, familias,
artenc, estados ,armazem where artigos.cf=familias.cf and
artigos.cf = convert (int,substring
(artenc.codigo,1,charindex('.',artenc.codigo)-1)) and
artigos.ca = convert(int,substring(artenc.codigo,charindex
('.',artenc.codigo)+1,2)) and artenc.numenc = '" &
fenc.TextBox1.Text & "' and estados.codigo =
artenc.estado and armazem.codigo = artenc.id order by
artenc.pos asc"
End If
fenc.SqlDataAdapter4.SelectCommand.Connection =
fenc.SqlConnection1
Dim dataset3 As New DataSet
fenc.SqlDataAdapter4.Fill
(dataset3, "artenc")
Console.WriteLine
(fenc.SqlDataAdapter4.SelectCommand.CommandText)
fenc.DataGrid2.DataSource =
dataset3.Tables("artenc")
fenc.DataGrid2.ReadOnly = True
--
fenc is reference to the caller form. The selectcommand
of the adapter has been raising a excpetion complaining
that a certain field doesn't belong to table artenc.
Sometimes its 'desconto','idcliente','estado',etc. but
they all belong to the table. And when i run the query in
query analyser it works ok and i haven't done any recent
changes in table artenc.
This doesn't make sense i am going crazy over this!!
Any sugestions ? Thanks
Kind Regards
Jorge 2 1346
Jorge,
In my opinion to much code to examine and to fragmental, however can it be
that you add dynamicly the wrong SQL string to your dataadapter?
Cor
"Jorge"
.. Hello
I have been for the last 2 days for abnormal behavior when try to refresh a datagrid from another form.
If Not (fenc Is Nothing) Then '' Actualiza a datagrid2 do formenc
fenc.SqlDataAdapter4.SelectCommand.CommandType = CommandType.Text If Not fenc.RadioButton1.Checked Then '' encomenda externa
fenc.SqlDataAdapter4.SelectCommand.CommandText = "select artenc.pos , artenc.quant , artenc.codigo , familias.desfam , artigos.desart , artenc.nvias , artenc.id , artenc.punit , artenc.prev ,artenc.penc , artenc.zona , artenc.cor , artenc.prazo , artenc.refcliente , artenc.quant_exp ,artenc.nenc ,artenc.obra ,artenc.posobra , estados.nome , artenc.desconto ,artenc.idcli ,artenc.obs_com , artenc.obs , artenc.obs_com2 ,artenc.margem ,artenc.tipo from artigos, familias, artenc, estados where artigos.cf=familias.cf and artigos.cf = convert (int,substring(artenc.codigo,1,charindex ('.',artenc.codigo)-1)) and artigos.ca = convert (int,substring(artenc.codigo,charindex('.',artenc. codigo) +1,2)) and artenc.numenc = '" & fenc.TextBox1.Text & "' and estados.codigo = artenc.estado order by artenc.pos asc" Else '' fornecimento de material
fenc.SqlDataAdapter4.SelectCommand.CommandText = "select artenc.pos Pos, artenc.quant Qtd, artenc.codigo Cod, familias.desfam Familia, armazem.designacao Artigo, artenc.nvias Vias, artenc.id Id, artenc.punit PCliente, artenc.prev PEnc,artenc.penc PTab, artenc.zona Zona, artenc.cor Cor, artenc.prazo Pz, artenc.refcliente RfCliente, artenc.quant_exp QtExp,artenc.nenc NEnc,artenc.obra Obra,artenc.posobra PosObra, estados.nome Estado, artenc.desconto Desconto,artenc.idcli IdCliente,artenc.obs_com ObsCom, artenc.obs Obs, artenc.obs_com2 ObsCom2 ,artenc.margem Margem,artenc.tipo Garantia from artigos, familias, artenc, estados ,armazem where artigos.cf=familias.cf and artigos.cf = convert (int,substring (artenc.codigo,1,charindex('.',artenc.codigo)-1)) and artigos.ca = convert(int,substring(artenc.codigo,charindex ('.',artenc.codigo)+1,2)) and artenc.numenc = '" & fenc.TextBox1.Text & "' and estados.codigo = artenc.estado and armazem.codigo = artenc.id order by artenc.pos asc" End If
fenc.SqlDataAdapter4.SelectCommand.Connection = fenc.SqlConnection1
Dim dataset3 As New DataSet
fenc.SqlDataAdapter4.Fill (dataset3, "artenc") Console.WriteLine (fenc.SqlDataAdapter4.SelectCommand.CommandText) fenc.DataGrid2.DataSource = dataset3.Tables("artenc")
fenc.DataGrid2.ReadOnly = True
-- fenc is reference to the caller form. The selectcommand of the adapter has been raising a excpetion complaining that a certain field doesn't belong to table artenc. Sometimes its 'desconto','idcliente','estado',etc. but they all belong to the table. And when i run the query in query analyser it works ok and i haven't done any recent changes in table artenc.
This doesn't make sense i am going crazy over this!!
Any sugestions ? Thanks
Kind Regards Jorge
Problem solved
used a backup of the project previous to the changes that
caused the error.
Jorge -----Original Message----- Jorge,
In my opinion to much code to examine and to
fragmental, however can it bethat you add dynamicly the wrong SQL string to your
dataadapter? Cor
"Jorge" .. Hello
I have been for the last 2 days for abnormal behavior when try to refresh a datagrid from another form.
If Not (fenc Is Nothing) Then '' Actualiza a datagrid2 do
formenc
fenc.SqlDataAdapter4.SelectCommand.CommandType = CommandType.Text If Not fenc.RadioButton1.Checked
Then '' encomenda externa
fenc.SqlDataAdapter4.SelectCommand.CommandText
= "select artenc.pos , artenc.quant , artenc.codigo , familias.desfam , artigos.desart , artenc.nvias , artenc.id , artenc.punit , artenc.prev ,artenc.penc , artenc.zona , artenc.cor , artenc.prazo , artenc.refcliente ,
artenc.quant_exp ,artenc.nenc ,artenc.obra ,artenc.posobra , estados.nome , artenc.desconto ,artenc.idcli ,artenc.obs_com , artenc.obs ,
artenc.obs_com2 ,artenc.margem ,artenc.tipo from artigos, familias, artenc, estados where artigos.cf=familias.cf and artigos.cf = convert (int,substring(artenc.codigo,1,charindex ('.',artenc.codigo)-1)) and artigos.ca = convert (int,substring(artenc.codigo,charindex
('.',artenc.codigo) +1,2)) and artenc.numenc = '" & fenc.TextBox1.Text & "' and estados.codigo = artenc.estado order by artenc.pos asc" Else '' fornecimento de material
fenc.SqlDataAdapter4.SelectCommand.CommandText
= "select artenc.pos Pos, artenc.quant Qtd, artenc.codigo Cod, familias.desfam Familia, armazem.designacao Artigo, artenc.nvias Vias, artenc.id Id, artenc.punit PCliente, artenc.prev PEnc,artenc.penc PTab, artenc.zona Zona, artenc.cor Cor, artenc.prazo Pz, artenc.refcliente RfCliente, artenc.quant_exp QtExp,artenc.nenc NEnc,artenc.obra Obra,artenc.posobra PosObra, estados.nome Estado, artenc.desconto Desconto,artenc.idcli IdCliente,artenc.obs_com ObsCom, artenc.obs Obs, artenc.obs_com2 ObsCom2 ,artenc.margem Margem,artenc.tipo Garantia from artigos, familias, artenc, estados ,armazem where artigos.cf=familias.cf
and artigos.cf = convert (int,substring (artenc.codigo,1,charindex('.',artenc.codigo)-1)) and artigos.ca = convert(int,substring
(artenc.codigo,charindex ('.',artenc.codigo)+1,2)) and artenc.numenc = '" & fenc.TextBox1.Text & "' and estados.codigo = artenc.estado and armazem.codigo = artenc.id order by artenc.pos asc" End If
fenc.SqlDataAdapter4.SelectCommand.Connection = fenc.SqlConnection1
Dim dataset3 As New DataSet
fenc.SqlDataAdapter4.Fill (dataset3, "artenc") Console.WriteLine (fenc.SqlDataAdapter4.SelectCommand.CommandText) fenc.DataGrid2.DataSource = dataset3.Tables("artenc")
fenc.DataGrid2.ReadOnly = True
-- fenc is reference to the caller form. The selectcommand of the adapter has been raising a excpetion complaining that a certain field doesn't belong to table artenc. Sometimes its 'desconto','idcliente','estado',etc. but they all belong to the table. And when i run the query
in query analyser it works ok and i haven't done any
recent changes in table artenc.
This doesn't make sense i am going crazy over this!!
Any sugestions ? Thanks
Kind Regards Jorge
. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: redneck_kiwi |
last post by:
Hi all:
I have a really weird problem. I am developing a customer catalog
system for my company and as such have delved into sessions for
authentication and access levels. So far, I have managed...
|
by: NanQuan |
last post by:
I'm hoping someone can help me solve this error since I am at a total
loss here. Usually I don't bother posting on any forums or groups on
the internet and prefer to solve stuff myself but this is...
|
by: amit |
last post by:
I am trying to compile the sample program genwin.sqc, using nsqlprep
which is used to precompile embedded sql in C. I am getting weird
errors and that is because windows.h is included in the...
|
by: Kathy Houtami |
last post by:
Hi there
I've been encountered with weird compile error using Access 97.
The error message is "Member or data member is not found" and it
highlighted a line of code that has not be changed and...
|
by: gh0st54 |
last post by:
Hi
I have a weird javascript error that only happens on my live server
when i open the page http://www.imrated.co.uk/reg.aspx
i get the error 'Problems with this page ... blablabla
Line : 3...
|
by: Alan Silver |
last post by:
Hello,
I have two weird problems here. I have a master page file that works
absolutely fine. When I load it up in VWD, I get a couple of weird (to
me) errors.
First, I get the error...
|
by: P Pulkkinen |
last post by:
Dear all,
sorry, i know this code is far little too long to debug here, but there is
really annoying logical error. If someone debugs this, I really offer warm
virtual handshake.
What this...
|
by: dtschoepe |
last post by:
Hi,
I am working on a project for school and I am trying to get my head
around something weird. I have a function setup which is used to get
an input from stdin and a piece of memory is created...
|
by: =?Utf-8?B?amVmZmVyeQ==?= |
last post by:
i need help with a combo box and this same code works on my first tab with a
combo box. The error or problem i have is this code causes an index out of
range error when i run it on my second combo...
|
by: d3vkit |
last post by:
I recently had a friend pass along some web work for me; a simple update. I for some reason decided I would do some overhauling of the page (he had been doing straight html and I figured some php...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |