2
Answers

Creating SQL Queries by user selecting what they want in query and what they want in output

krolick

krolick

19y
2.2k
1
I have 3 array's that collect the input from user: selectArray - collects the data that the user wants to see in the result of the query. fromArray - this is all the tables needed for the query based on users select data. whereArray - all the joins necessary for the query based on users selection. I now need to put all this into a useable SQL Statement to send server. In my windows app I used 4 textboxes, reading each array into a textbox and a 4th to combine into a single SQL Statement. I am having problems using a textbox in my Web App to do the same thing. There is no append attribute for a web textbox and i am trying to use the insert attribute. Here is section of code reading array and inserting into textbox. I am using C# codebehind int selectcount = selectList.Count; int s; if (selectcount > 0) { TextBox1.Text = "Select "; int textCount = TextBox1.Text.Length; for (s = 1; s < selectcount; s++) { TextBox1.Text.Insert(textCount, selectList[s-1] + ","); textCount = TextBox1.Text.Length; } TextBox1.Text.Insert(textCount, selectList[s-1] + ""); } TextBox1 as the Select in it and count of 7 (I have space after word Select) when the for statement runs nothing gets added to the TextBox1. Any ideas will be greatly appreciated. Thanks CGN38
Answers (2)