SQL Select Value to String
-
This is probably a really easy question, but i need to select a value from an SQL table and put it in a string. The table - PRODUCTS, has a column called QTY and a column called ID I need to select the QTY value where ID = x. How do i select the single value and put it into a string?
-
This is probably a really easy question, but i need to select a value from an SQL table and put it in a string. The table - PRODUCTS, has a column called QTY and a column called ID I need to select the QTY value where ID = x. How do i select the single value and put it into a string?
I am not sure if what you have asked is this simple but: How about building an SqlCommand (System.Data.SqlClient.SqlCommand or SqlCommandBuilder) SELECT QTY FROM PRODUCTS WHERE ID = 'x' You may need to search through MSDN to learn how to use these classes.
Always keep the Murphy Rules in mind!
-
I am not sure if what you have asked is this simple but: How about building an SqlCommand (System.Data.SqlClient.SqlCommand or SqlCommandBuilder) SELECT QTY FROM PRODUCTS WHERE ID = 'x' You may need to search through MSDN to learn how to use these classes.
Always keep the Murphy Rules in mind!