Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding more fields into a dataset
Message
From
22/05/2013 09:54:53
 
 
To
All
General information
Forum:
ASP.NET
Category:
Databases
Title:
Adding more fields into a dataset
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01574472
Message ID:
01574472
Views:
61
I have a dataset that is constructed from various sources. So, the number of fields in them varies from one places to another. However, it is all for the same table. The goal is to find the missing fields and add them into the dataset.

The first part is to detect the missing field. This is no problem. I have a collection of all the required fields. I compare with what I have in the dataset. If it is not in there, I add them up in a variable such as "Table.FirstName,Table.LastName,etc.". Some sources may have 1 record, others 136 and so on. So, I need to execute a SQL command which will go get the missing field values from the table so the result would be the final version of the dataset.

Once step I have to go through is to get all the primary keys. So, lets say I have them up in a collection, in a list such as "12, 1024, 3244, 1211" or else. I then need to execute a SQL command to get the missing fields based on those primary keys. I am pretty sure there is a better way to achieve that then to construct a SQL command with a bunch of WHERE clauses with an OR statement for each of the primary key. Anyone would have an idea on a better route to take?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform