Filter DataSource before presente data in gridview

nandoliveira

Member
Joined
Jun 17, 2008
Messages
7
Programming Experience
Beginner
hi, i'm using one datasource to colect information from my database and to fill one gridview, but before fill it i would like to pick the field txt_alt put it in one function [this function sees if the are upper letters after the first one], case exists i want to present it in the gridView, case not e don't want to present it... is that possible? [Because i'm trying to filter that in the gridview and i can't ]


<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
...
InsertCommand="INSERT INTO [errorwords] ([id_word], [txt_orig], [txt_alt], [n_words], [n_errors]) VALUES (@id_word, @txt_orig, @txt_alt, @n_words, @n_errors)"

OldValuesParameterFormatString="original_{0}" ProviderName="System.Data.SqlClient"

SelectCommand="SELECT * FROM [errorwords] WHERE (([n_errors] <> @n_errors) AND ([txt_alt] NOT LIKE '%' + @txt_alt + '%') AND ([txt_alt] NOT LIKE '%' + @txt_alt2 + '%') AND ([txt_alt] NOT LIKE '%' + @txt_alt3 + '%') AND ([txt_alt] NOT LIKE '%' + @txt_alt4 + '%') AND ([txt_alt] NOT LIKE '%' + @txt_alt5 + '%') AND ([txt_alt] NOT LIKE '%' + @txt_alt6 + '%') AND ([txt_alt] NOT LIKE '%' + @txt_alt7 + '%') AND ([txt_alt] NOT LIKE '%' + @txt_alt8 + '%') AND ([txt_alt] NOT LIKE '%' + @txt_alt9 + '%') AND ([txt_alt] NOT LIKE '%' + @txt_alt10 + '%')) ORDER BY [txt_alt] DESC"
UpdateCommand="UPDATE [errorwords] SET [txt_orig] = @txt_orig, [txt_alt] = @txt_alt, [n_words] = @n_words, [n_errors] = 1 WHERE [id_word] = @original_id_word AND [txt_orig] = @original_txt_orig AND [txt_alt] = @original_txt_alt AND [n_words] = @original_n_words AND [n_errors] = @original_n_errors">
<SelectParameters>
<asp:parameter DefaultValue="0" Name="n_errors" Type="Int32" />
<asp:parameter DefaultValue="ø" Name="txt_alt" Type="String" />
<asp:parameter DefaultValue="¢" Name="txt_alt2" Type="String" />
<asp:parameter DefaultValue="Ā" Name="txt_alt3" Type="String" />
<asp:parameter DefaultValue="ń" Name="txt_alt4" Type="String" />
<asp:parameter DefaultValue="ē" Name="txt_alt5" Type="String" />
<asp:parameter DefaultValue="Ŗ" Name="txt_alt6" Type="String" />
<asp:parameter DefaultValue="æ" Name="txt_alt7" Type="String" />
<asp:parameter DefaultValue="ģ" Name="txt_alt8" Type="String" />
<asp:parameter DefaultValue="Ķ" Name="txt_alt9" Type="String" />
<asp:parameter DefaultValue="ß" Name="txt_alt10" Type="String" />
<asp:parameter DefaultValue="?" Name="txt_alt11" Type="String" />
</SelectParameters>

...

</asp:SqlDataSource>
 
Back
Top