jbellCNS
Programmer
- Jun 28, 2011
- 9
I am re-arranging some sql data, and am having issues building my query.
The source table layout is as follows:
In my program, I know the destination table/col from the src column. There will be many rows in the src table, even for a single update query, and it will build the where clause for a number of the values based on the source.
The thing is, there will be multiple column/values for each query that is executed. Right now I have created a class called sqlTable to contain the information for the queries. Each table object has a list of queries, and I want a list of column/value pairs for each query. I have been trying to use the where clause as the identifier for each query.
I have been doing a lot of PHP in recent years, and I know exactly how I would code this in PHP. I am trying to build a variable that looks like this:
However I have been having problems with getting the syntax correct for VB Express 2010 (if this is the wrong forum please tell me where I need to move this thread to)
I have gone through a number of attempted solutions using lists, dictionaries, and collections over the course of the past week. How can I get that kind of functionality using VB.net syntax? Any input would be most welcome.
The source table layout is as follows:
Code:
id
filename
src
value
In my program, I know the destination table/col from the src column. There will be many rows in the src table, even for a single update query, and it will build the where clause for a number of the values based on the source.
The thing is, there will be multiple column/values for each query that is executed. Right now I have created a class called sqlTable to contain the information for the queries. Each table object has a list of queries, and I want a list of column/value pairs for each query. I have been trying to use the where clause as the identifier for each query.
I have been doing a lot of PHP in recent years, and I know exactly how I would code this in PHP. I am trying to build a variable that looks like this:
Code:
while ($row = mssql_fetch_assoc) {
$arrQuery['strWhere']['col'][]= $row['col']
$arrQuery['strWhere']['val'][]= $row['val']
}
However I have been having problems with getting the syntax correct for VB Express 2010 (if this is the wrong forum please tell me where I need to move this thread to)
I have gone through a number of attempted solutions using lists, dictionaries, and collections over the course of the past week. How can I get that kind of functionality using VB.net syntax? Any input would be most welcome.