Apologizes if this has been asked before but I was not sure even how to search for this.
I am using VB for code behind & want I am trying to find out is this;
I have a defined SqlCommand:
Dim cmd As New SqlCommand("Select [Field1], [Field2], [Field3] From [Table] Where [FieldX] = @parameter ")
How can I add another field using code with out changing the base SqlCommand?
So the temp SqlCommand would look like the following:
Dim cmd As New SqlCommand("Select [Field1], [Field2], [Field3] [Field4 Added Dynamically] From [Table] Where [FieldX] = @parameter ")
If I have confused anyone or everyone please let me know and I will do my best to try an explain clearer.
MC
Field4, and assign the column name to it. In your SQL command, just concatenate this variable accordingly.