Last post May 09, 2019 10:49 AM by PatriceSc
May 07, 2019 01:37 PM|E.RU|LINK
I have code which gets data based on column number from a gridview. to avoid having big long repetative pieces of code I decided to make a generic function. The problem I have now is that i am unsure how to code it so it goes to the next column row without
maually in putting it in the code.
The code I need help with :
how do I code it so it goes to column c(1) then c(2) etc :
objTblNbrs = (From c In argMstTblNbrs Select c(0)).Distinct.ToList()
May 07, 2019 02:28 PM|mgebhard|LINK
I do not understand the code. Are you trying to build dynamic SQL?
May 08, 2019 10:02 AM|samwu|LINK
According to your description, I couldn’t understand your requirement clearly.
You said you want to gets data based on column number from a gridview, but in your code, it get value by the index, In that case, only GridViewRow can do that. So please describe your question clearly.
And do you want to get data from the GridView or GridView DataSource (such as DataTable)?
May 09, 2019 08:19 AM|E.RU|LINK
I want to know if I can code it so it loops through the columns in a gridview. thats the code I have so far, I change the zero to 1 each time to get new column.
May 09, 2019 10:49 AM|PatriceSc|LINK
And you can't just use a variable rather than 0 ie something such as :
var t = new DataTable();
var q = (from DataRow c in t.Rows select c[i]).Distinct(); // select c(i) using VB ?
I realized late you are using VB but it should be basically the same idea.