Compatibilité SQL Server 7 - SQL Server 2000 ?

L

Ludovic Lemarinel

Bonjour,

J'ai developpé une application sous VB.Net qui utilise un datagrid .

Ce datagrid utilise un dataTable d'un DataSet comme datasource. ce dataset
est rempli de la sorte :

'Debut du code

requete = "SELECT ln_nomencdtl_articleentree as 'Article', CASE WHEN
e.en_item_key IS NULL THEN po_nstk_desc ELSE en_item_desc END as
'Désignation', CASE WHEN e.en_item_key IS NULL THEN 'UN' ELSE uom_key END as
'Unité', CASE WHEN en_type_key IN(2, 10) THEN CASE " & poidsun & " WHEN 0
THEN ln_nomencdtl_quantite ELSE ln_nomencdtl_quantite * " & poidsun & " END
ELSE CASE " & poidsun & " WHEN 0 THEN ln_nomencdtl_quantite ELSE
ln_nomencdtl_quantite * " & poidsun & " END END as 'Qté Unités', CASE WHEN
en_type_key IN(2, 10) THEN (ln_nomencdtl_quantite * 100) ELSE 0 END as
'Qté', en_type_key FROM ln_nomencdtl_tbl d LEFT JOIN en_item_tbl e ON
d.ln_nomencdtl_articleentree = e.en_item_key LEFT JOIN po_nstk_tbl ns ON
d.ln_nomencdtl_articleentree = ns.po_nstk_key AND d.gl_cmp_key =
ns.gl_cmp_key WHERE d.gl_cmp_key='" & pGL_CMP_KEY & "' AND sf_plant_key='" &
pUsine & "' AND ln_nomenchdr_articlesortie='" & tArticlePF.Text & "' AND
ln_nomenchdr_ver='" & NumVer & "' AND ln_machine_idmachine = " & idmachine

da = New SqlDataAdapter(New SqlCommand(requete, sqlcn))

ds.Tables.Clear()

da.Fill(ds)

'Fin du code

Avec les déclarations qui vont bien...

Tout ce code fonctionne à merveille sur un Serveur SQL Server 7 sous Windows
NT4.

Par contre, lorsque je lance mon appli en me connectant à un Serveur Windows
Server 2003 avec SQL Server 2000, rien ne va plus: ca fonctionne -presque-
bien, sauf qu'il y a un moment, ou ma requete me remplit mon dataTable avec
0 (zero) ligne, alors qu'en executant ma requete dans un analyseur de
requete, elle me renvoie 7 lignes.

La base de données installée sur le serveur SQL Server 2000 est la copie
conforme de la base installée sur le SQL Server 7, et j'ai essayé les
différents niveaux de compatibilité disponibles (de 6.5 à 8.0), sans
resultat...

Quelqu'un a-t-il déjà vécu ce probleme? et si oui, avez vous une solution ?

Merci.
 
C

Cor

Hello Ludocic,

This is an International, by agreement we use only the English language in
this newsgroup.

I do not see an error in the VB.language code, I would try it with a more
simpler Select if it has to do with the SQL7 - SQL2000 or NT - Server 2003

But you can better ask this question in English in the international
newsgroup

Microsoft.public.dotnet.framework.adonet

I hope this helps?

Cor

C'est un international, par accord que nous employons seulement l'anglais
dans ce newsgroup.

Je ne vois pas une erreur dans le code VB.language, je l'essayerais avec un
plus simple Select s'il doit faire avec le SQL7 - SQL2000 ou le NT - le
Server2003

Mais vous pouvez mieux poser cette question en anglais dans le newsgroup
international

Microsoft.public.dotnet.framework.adonet

J'espère que ceci aide?

Cor
 
L

Ludovic Lemarinel

Sorry, I made a mistake while selecting the newsgroup ;)

About my query, the problem does not appear all the time, but just from time
to time, with the same query:
Sometimes, it fills the dataTable with the needed records, and sometimes, it
doesn't fill, but the query always give results in Query Analyser (don't
know if it's his name in english !).

Any ideas ?
 
C

Cor

Hi Ludovic,

Real weird, but try it in the adonet group, I see a lot of messages and also
in the adonet group, but not yours problem, but you never know.

(Although do not have to much hope, your Select is very difficult to expect
an answer in a newsgroup)

I know one of the answers you will get:
use the dataadapter paramaters instead of the connection in the selects
string with &
And that advice I can give you here in advance.
(It makes it more readable I think)

Cor
 

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

Top