﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » select XXXXXx where   in Bo</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 08:26:01 GMT</lastBuildDate><ttl>20</ttl><item><title>select XXXXXx where   in Bo</title><link>http://forum.strataframe.net/FindPost17540.aspx</link><description>Hi, &lt;/P&gt;&lt;P&gt;why this code &lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.ActeursBO1.FillDataTable(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"select * from acteurs where login = "&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &amp;amp; alltrim(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.ColorizedTextBox1.Text))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;deosn't run&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;I have the error&lt;BR&gt; &lt;IMG src="http://forum.strataframe.net/Uploads/Images/817040fa-4bd8-4e6b-a40b-5980.JPG"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;column name not valid :'eric'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;eric is the&amp;nbsp; login text&amp;nbsp;&amp;nbsp; that i wrote in the colorizedtext??&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;i try&amp;nbsp; the code &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;me.acteursBO1.seek(" login = " &amp;amp; me.colorizedtext1.text) &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;and its dosent&amp;nbsp; run. its the same error &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;What i have to do ???&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Thanks &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Eric&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Wed, 02 Jul 2008 13:41:59 GMT</pubDate><dc:creator>Eric Leissler</dc:creator></item><item><title>RE: select XXXXXx where   in Bo</title><link>http://forum.strataframe.net/FindPost17548.aspx</link><description>Eric,&lt;P&gt;C'est exactement comme pour le SQL Pass-Through en VFP: il te manque des simples quotes autour de ta valeur alltrim(&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.ColorizedTextBox1.Text).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Comme tu l'as écrit, ta chaine de requete est select * from acteurs where login = eric&lt;BR&gt;alors que tu devrais avoir select * from acteurs where login = &lt;STRONG&gt;'&lt;/STRONG&gt;eric&lt;STRONG&gt;'&lt;BR&gt;&lt;/STRONG&gt;donc une requete qui serait &lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.ActeursBO1.FillDataTable(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"select * from acteurs where login = '"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &amp;amp; alltrim(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.ColorizedTextBox1.Text)) &amp;amp;"'"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Mais il vaut mieux prendre l'habitude des requètes paramétrées comme te le montre Trent</description><pubDate>Wed, 02 Jul 2008 13:41:59 GMT</pubDate><dc:creator>Michel Levy</dc:creator></item><item><title>RE: select XXXXXx where   in Bo</title><link>http://forum.strataframe.net/FindPost17547.aspx</link><description>thank's &lt;/P&gt;&lt;P&gt;i will try &lt;/P&gt;&lt;P&gt;Eric</description><pubDate>Wed, 02 Jul 2008 13:41:24 GMT</pubDate><dc:creator>Eric Leissler</dc:creator></item><item><title>RE: select XXXXXx where   in Bo</title><link>http://forum.strataframe.net/FindPost17545.aspx</link><description>The problem is that you are trying to build a command string (which is generally not good practice) and not providing quotes.&amp;nbsp; You will want to create a parameterized query, otherwise your users&amp;nbsp;can accidentally break your query code (i.e. add a quote in the text box, etc.)&lt;P&gt;[codesnippet]Public Sub FillByLoginName(Byval loginName as String)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Establish Locals&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim cmd As New SqlCommand("SELECT * FROM acteurs WHERE login = @loginName")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Create the parameters&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.Parameters.AddWIthvalue("@loginName", loginName).SqlDbType = SqlDbType.VarChar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Execute the query&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; me.FillDataTable(cmd)&lt;BR&gt;End Sub[/codesnippet]&lt;/P&gt;&lt;P&gt;Also, instead of programming queyr logic into a form, you should really create a method, like above, in the BO itself and then pass that over to the BO to execute the query instead of placing that logic in your form.</description><pubDate>Wed, 02 Jul 2008 13:25:24 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>