SQL Server - ADO.NET ou DBNetLib : pas pareil, mais pourquoi ?!!!

Asked By thelastjed
25-Sep-08 09:54 AM
Bonjour,

Une même procédure stockée lancée depuis un appel ADO.NET (applciation
cliente en VB.NET) et depuis SQL QueryBuilder de SQLServer 2000 se comporte
différemment : via ADO.NET, ça plante en timeout à tous les coups. Via SQLQB,
lancé en ligne de commande T-SQL avec les paramètres équivalents, ça passe
sans réel problème.

Quelqu'un a-t-il une idée qui me tranquilliserait  ?
Merci
-----------------------------------------------------------------------------
Client : Windows XP SP2 / framework v1.0.3705.6018
Serveur : SQLServer 2005 SP2 + base en compatibilité 2000
ADO.NET
(1)
VB.NET
(1)
XP
(1)
Statistics
(1)
  TheSteph replied...
25-Sep-08 01:37 PM
Essayez en augmentant le SqlCommand.CommandTimeout dans le programme en
VB.net. Par défaut le CommandTimeout est de 30 secondes et probablement
indéfini dans SQLQB...

Steph.
  Sylvain Lafontaine replied...
25-Sep-08 02:15 PM
Question de plan d'exécution ("bad query plan" en anglais).  Certains
options comme ARITHABORT ou le login (si vous ne précisez pas le schéma (par
exemple dbo.) de vos tables/SP/Views) peuvent être différentes entre les
deux systèmes ce qui peut conduire à des plans d'exécution différents. et si
un de ces plans est mauvais, vous verrez apparaître ce problème de lenteur.

La première chose à voir est d'exécuter la commande SET ARITHABORT OFF dans
le QueryBuilder avant de lancer la procédure stockée (SP) et voir si vous
aurez le même problème de vitesse.  Si oui, vous pouvez regarder le plan
d'exécution et voir ce qui ne va pas avec.

La deuxième chose à faire est de voir si l'ajout de l'option WITH RECOMPILE
corrige le problème de vitesse.  Si Oui, vous pouvez regarder la question du

Enfin, préciser le schéma de vos objets partout; clairez les caches, mettez
à jour les statistics, réindexer si nécessaire et enfin, regardez si l'ajout
de hint pour l'utilisation des indexes ne corrigera pas votre problème.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
  thelastjed replied...
26-Sep-08 09:41 AM
Merci pour le tuyau.

En fait, il s'agissait d'un timeout laissé par défaut dans une SQLCommand
(c'est à dire 30s), là où le traitement en coûtait 10 de plus.

C'est corrigé. Cerise, on a même optimisé la procédure... :)

Merci encore.
help
seems very limiting. Michael Michael C (mike@nospam.com) writes: That must explain ahy in VB .Net can write: Using cn As SqlConnection = setup_connection(), _ cmd As SqlCommand = cn.CreateCommand() But I not know about this feature. If this is a limitation then the limitation is in ado.net, not linq itself. If ado.net can pass a table variable to sqlserver then linq can. Michael The LINQ provider for not. Certainly the industry has not had any problem picking up .net and C# or vb.net. But my point was this is not a limitation of linq. If it is not
ADO vs ADO.net SQL Server is that the main difference between ADO and ADO.net is ADO = native C++, need write more code to do query ADO.net = managed C++, write less code to do the same thing? SQL Server Programming Discussions Visual Studio.NET (1) SQL Server (1) System.Data.SqlClient (1) Visual Studio (1) ADO.NET (1) VB (1) Database (1) Indicium (1) Not exactly. ADO is COM, usable from, for
Import vb.Net xml file to sql server 2000? SQL Server Greetings, In a vb.net program I write data from a dataTable to an xml text file. The program creates the xml text file which I can read from another vb.net program, so the xml is well formed and validated. . . But when I try to import an sp I can use? How to do this? Thanks, Rich SQL Server Programming Discussions VB.NET (1) Table (1) Create (1) Text (1) Excel (1) Procedure (1) Schema (1) Database (1
ADO.NET connect fails after some hours (cannot get connection from pool) SQL Server Hi, We have Any suggestions welcome, Rene SQL Server Programming Discussions SQL Server 2000 (1) ASP.NET (1) ADO.NET (1) VB.NET (1) Database (1) VPN (1) Datatools (1) Datagrid (1) Firstly: There was no way for newsgroup before posting yours - always a recommended practice) , but this is a classic ADO newsgroup. ADO.Net bears very little resemblance to classic ADO so, while you may be lucky enough to
ON". This one seems particularly annoying, as it seems it is getting inserted automatically by ADO.Net. Accounts for about 20% of the data traffic, and one additional round trip do the So that is one more thing to look into. Exactly what in your usage of ADO .Net (and you still have not told us which data provider you are using) triggers the have that flaw?". Because it is only a matter of time before someone discovers that ADO.NET has flaws and how long will it be before MS declares ADO.NET and .NET legacy, they are bored with it, and start creating other new "cool technology