Bahatmut
Active member
Possible Query structure problem.[RESOLVED]
I had hoped to not have to use this forum again (no offense) but I cannot figure out why (and yes, I checked all the sources I coudl find, help, MSDN, etc etc) this query doesn't seem to return the proper results.
Query Format:
[/size]
The TextBox 1 and 2 values are properly converted mm/dd/yyyy values, and the Sort order is determinded this way:
However, the GenSearch I think is the problem, it's possible values are determined this way:
When I run with a forced pause in the debug, the radio buttons seem to be working fine, and the proper values are being inserted for the correct item. However, it never seems to pull right, it acts as if it ALWAYS gets the 'GenSearch = NOTHING' value on the actual data that is pulled? WHere do I have the thing messed up? ANd yes, the formatting of all textboxes and strings for the query occur BEFORE the actual String.Format[/size]
I had hoped to not have to use this forum again (no offense) but I cannot figure out why (and yes, I checked all the sources I coudl find, help, MSDN, etc etc) this query doesn't seem to return the proper results.
Query Format:
VB.NET:
[size=2]VideoQuery = [/size][size=2][color=#0000ff]String[/color][/size][size=2].Format("SELECT Ref, Title, Release_Date, Cost_Price, Category, Spare1 from Videos WHERE (Release_Date BETWEEN #{0}# AND #{1}#) {2} ORDER BY {3}", TextBox1.Text, TextBox2.Text, GenSearch, SortOrder)[/size]
[size=2]
The TextBox 1 and 2 values are properly converted mm/dd/yyyy values, and the Sort order is determinded this way:
VB.NET:
[/size]
[size=2][size=2][/size][size=2][color=#0000ff]If[/color][/size][size=2] RadioButton1.Checked = [/size][size=2][color=#0000ff]True[/color][/size][size=2][color=#0000ff]Then[/color][/size][size=2] SortOrder = "Release_Date ASC, Ref DESC"
[/size][size=2][color=#0000ff]If[/color][/size][size=2] RadioButton2.Checked = [/size][size=2][color=#0000ff]True[/color][/size][size=2][color=#0000ff]Then[/color][/size][size=2] SortOrder = "Release_Date ASC, Title ASC"[/size]
[size=2]
However, the GenSearch I think is the problem, it's possible values are determined this way:
VB.NET:
[/size]
[size=2][color=#0000ff]If[/color][/size][size=2] RadioButton3.Checked = [/size][size=2][color=#0000ff]True[/color][/size][size=2][color=#0000ff]Then[/color][/size][size=2] GenSearch = [/size][size=2][color=#0000ff]Nothing
[/color][/size][size=2][color=#0000ff]If[/color][/size][size=2] RadioButton4.Checked = [/size][size=2][color=#0000ff]True[/color][/size][size=2][color=#0000ff]Then[/color][/size][size=2] GenSearch = "AND (Genre='Adult' OR 'P.S.')"
[/size][size=2][color=#0000ff]If[/color][/size][size=2] RadioButton5.Checked = [/size][size=2][color=#0000ff]True[/color][/size][size=2][color=#0000ff]Then[/color][/size][size=2] GenSearch = "And (Genre NOT Like 'Adult' or 'P.S.')"
[/size][size=2]
When I run with a forced pause in the debug, the radio buttons seem to be working fine, and the proper values are being inserted for the correct item. However, it never seems to pull right, it acts as if it ALWAYS gets the 'GenSearch = NOTHING' value on the actual data that is pulled? WHere do I have the thing messed up? ANd yes, the formatting of all textboxes and strings for the query occur BEFORE the actual String.Format[/size]
Last edited: