Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting all records just for the schema
Message
De
09/04/2007 06:06:57
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/04/2007 12:33:33
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01213027
Message ID:
01213367
Vues:
8
>>ExecuteReader doesn't get all the records (it doesn't even get the first until you tell it to Read().
>>It is a way to get the schema but you could as well query schema catalogs for it.
>
>I'm sorry to say the opposite but this this is not technically true. Before, I had:
>
>
>lcSQL = "Select * From " + tcTable + " Where 1=2"
>oCommand.CommandText = lcSQL
>oDataReader = oCommand.ExecuteReader()
>oDataTable = oDataReader.GetSchemaTable
>
>
>As, I wanted to make sure that I would have a minimum SQL command to be executed returning no record in order to get an immediate result. Then, you mentioned that ExecuteReader() does not pull any record. So, I changed to this:
>
>
>lcSQL = "Select * From " + tcTable
>oCommand.CommandText = lcSQL
>oDataReader = oCommand.ExecuteReader()
>oDataTable = oDataReader.GetSchemaTable
>
>
>As soon as I did this on a 500000 records table, this brought the application down. A SQL query is in fact executed for all the records. I had to put back the condition.

Michel,
You're right on that, however if you include CommandBehavior.SchemaOnly then query is not executed.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform