Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 27, 2013 07:12 PM by Mary1
All-Star
118619 Points
18779 Posts
Jan 26, 2013 02:20 AM|LINK
Mary1 GenerateUniqueData
Hi,
Where did you call this function?
And please show us your aspx codes?
0 Points
9 Posts
Jan 26, 2013 12:08 PM|LINK
Decker Dong - MSFT Where did you call this function?
I called this function in ParametrizedQuery(). I 've shown that on the previous code.
Decker Dong - MSFT And please show us your aspx codes?
Here are aspx codes:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="DataGridTest" %> <%@ Register assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Web.UI.WebControls" tagprefix="asp" %> <%@ Register assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .style1 { width: 63px; } .style2 { width: 89px; } .style3 { width: 334px; } #Button2 { width: 182px; } </style> <script language="javascript" type="text/javascript"> // <!CDATA[ function Button2_onclick() { } // ]]> </script> </head> <body> <form id="form1" runat="server"> <div style="width: 605px"> <b>СИСТЕМ ЗА ИЗВЕШТАВАЊЕ </b><br /> <br /> <br /> Одаберите идентификациони број курса и годину за који желите да извршите анализу.<br /> <table style="width: 98%; height: 213px;"> <tr> <td bgcolor="White" class="style1"> </td> <td class="style2"> </td> <td class="style3" rowspan="6"> <asp:Button ID="Button2" runat="server" BackColor="#0099FF" Text="Дескриптивна статистика" /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <asp:Button ID="Button1" runat="server" BackColor="#0099FF" Text="Предвиђање вероватноће" Width="187px" onclick="Button1_Click" /> <br /> </td> </tr> <tr> <td bgcolor="White" class="style1"> </td> <td class="style2"> </td> </tr> <tr> <td bgcolor="Aqua" class="style1"> Курсс</td> <td class="style2"> <asp:DropDownList ID="DropDownList6" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource6" DataTextField="Course" DataValueField="Course" Height="19px" Width="100px"> </asp:DropDownList> </td> </tr> <tr> <td bgcolor="#66FFFF" class="style1"> Година</td> <td class="style2"> <asp:DropDownList ID="DropDownList7" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource3" DataTextField="Year" DataValueField="Year" Height="19px" Width="100px"> </asp:DropDownList> </td> </tr> <tr> <td bgcolor="White" class="style1"> </td> <td class="style2"> </td> </tr> <tr> <td bgcolor="White" class="style1"> </td> <td class="style2"> </td> </tr> </table> <br /> <br /> <br /> <br /> <asp:GridView ID="GridView1" runat="server" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None"> <RowStyle BackColor="#FFFBD6" ForeColor="#333333" /> <Columns> <asp:BoundField /> </Columns> <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /> <EmptyDataTemplate> </EmptyDataTemplate> <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView> <br /> <br /> <asp:GridView ID="GridView2" runat="server" CellPadding="4"> </asp:GridView> </div> <br /> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Moodle bazaConnectionString %>" SelectCommand="SELECT DISTINCT [Hour] FROM [Log] WHERE ([Hour] <> @Hour) ORDER BY [Hour]"> <SelectParameters> <asp:Parameter DefaultValue="hour" Name="Hour" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Moodle bazaConnectionString %>" SelectCommand="SELECT DISTINCT [Day] FROM [Log] WHERE ([Day] NOT LIKE '%' + @Day + '%') ORDER BY [Day]"> <SelectParameters> <asp:Parameter DefaultValue="day" Name="Day" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:Moodle bazaConnectionString %>" SelectCommand="SELECT DISTINCT [Year] FROM [Log]"> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:Moodle bazaConnectionString %>" SelectCommand="SELECT DISTINCT [Year] FROM [Log] WHERE ([Year] NOT LIKE '%' + @Year + '%') ORDER BY [Year]"> <SelectParameters> <asp:Parameter DefaultValue="year" Name="Year" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:Moodle bazaConnectionString %>" SelectCommand="SELECT DISTINCT [Activity] FROM [Log] WHERE ([Activity] NOT LIKE '%' + @Activity + '%') ORDER BY [Activity]"> <SelectParameters> <asp:Parameter DefaultValue="activity" Name="Activity" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource6" runat="server" ConnectionString="<%$ ConnectionStrings:Moodle bazaConnectionString %>" SelectCommand="SELECT DISTINCT [Course] FROM [Log] WHERE ([Course] NOT LIKE '%' + @Course + '%') ORDER BY [Course]"> <SelectParameters> <asp:Parameter DefaultValue="course" Name="Course" Type="String" /> </SelectParameters> </asp:SqlDataSource> </form> </body> </html>
Jan 26, 2013 12:22 PM|LINK
I called that in ParametrizedQuery(), you could see that on previous code.
Jan 26, 2013 11:32 PM|LINK
Mary1 cellvalue != DropDownList6.SelectedItem.Value
cellvalue != DropDownList6.SelectedItem.Value
Please debug your cellValue and SelectedItem.Value to see their values.
Jan 27, 2013 07:12 PM|LINK
It's working now. Thank you Decker Dong!
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Comparing DropDownList value and GridView value in specific column
Jan 26, 2013 02:20 AM|LINK
Hi,
Where did you call this function?
And please show us your aspx codes?
Mary1
0 Points
9 Posts
Re: Comparing DropDownList value and GridView value in specific column
Jan 26, 2013 12:08 PM|LINK
I called this function in ParametrizedQuery(). I 've shown that on the previous code.
Here are aspx codes:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="DataGridTest" %> <%@ Register assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Web.UI.WebControls" tagprefix="asp" %> <%@ Register assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .style1 { width: 63px; } .style2 { width: 89px; } .style3 { width: 334px; } #Button2 { width: 182px; } </style> <script language="javascript" type="text/javascript"> // <!CDATA[ function Button2_onclick() { } // ]]> </script> </head> <body> <form id="form1" runat="server"> <div style="width: 605px"> <b>СИСТЕМ ЗА ИЗВЕШТАВАЊЕ </b><br /> <br /> <br /> Одаберите идентификациони број курса и годину за који желите да извршите анализу.<br /> <table style="width: 98%; height: 213px;"> <tr> <td bgcolor="White" class="style1"> </td> <td class="style2"> </td> <td class="style3" rowspan="6"> <asp:Button ID="Button2" runat="server" BackColor="#0099FF" Text="Дескриптивна статистика" /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <asp:Button ID="Button1" runat="server" BackColor="#0099FF" Text="Предвиђање вероватноће" Width="187px" onclick="Button1_Click" /> <br /> </td> </tr> <tr> <td bgcolor="White" class="style1"> </td> <td class="style2"> </td> </tr> <tr> <td bgcolor="Aqua" class="style1"> Курсс</td> <td class="style2"> <asp:DropDownList ID="DropDownList6" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource6" DataTextField="Course" DataValueField="Course" Height="19px" Width="100px"> </asp:DropDownList> </td> </tr> <tr> <td bgcolor="#66FFFF" class="style1"> Година</td> <td class="style2"> <asp:DropDownList ID="DropDownList7" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource3" DataTextField="Year" DataValueField="Year" Height="19px" Width="100px"> </asp:DropDownList> </td> </tr> <tr> <td bgcolor="White" class="style1"> </td> <td class="style2"> </td> </tr> <tr> <td bgcolor="White" class="style1"> </td> <td class="style2"> </td> </tr> </table> <br /> <br /> <br /> <br /> <asp:GridView ID="GridView1" runat="server" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None"> <RowStyle BackColor="#FFFBD6" ForeColor="#333333" /> <Columns> <asp:BoundField /> </Columns> <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /> <EmptyDataTemplate> </EmptyDataTemplate> <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView> <br /> <br /> <asp:GridView ID="GridView2" runat="server" CellPadding="4"> </asp:GridView> </div> <br /> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Moodle bazaConnectionString %>" SelectCommand="SELECT DISTINCT [Hour] FROM [Log] WHERE ([Hour] <> @Hour) ORDER BY [Hour]"> <SelectParameters> <asp:Parameter DefaultValue="hour" Name="Hour" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Moodle bazaConnectionString %>" SelectCommand="SELECT DISTINCT [Day] FROM [Log] WHERE ([Day] NOT LIKE '%' + @Day + '%') ORDER BY [Day]"> <SelectParameters> <asp:Parameter DefaultValue="day" Name="Day" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:Moodle bazaConnectionString %>" SelectCommand="SELECT DISTINCT [Year] FROM [Log]"> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:Moodle bazaConnectionString %>" SelectCommand="SELECT DISTINCT [Year] FROM [Log] WHERE ([Year] NOT LIKE '%' + @Year + '%') ORDER BY [Year]"> <SelectParameters> <asp:Parameter DefaultValue="year" Name="Year" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:Moodle bazaConnectionString %>" SelectCommand="SELECT DISTINCT [Activity] FROM [Log] WHERE ([Activity] NOT LIKE '%' + @Activity + '%') ORDER BY [Activity]"> <SelectParameters> <asp:Parameter DefaultValue="activity" Name="Activity" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource6" runat="server" ConnectionString="<%$ ConnectionStrings:Moodle bazaConnectionString %>" SelectCommand="SELECT DISTINCT [Course] FROM [Log] WHERE ([Course] NOT LIKE '%' + @Course + '%') ORDER BY [Course]"> <SelectParameters> <asp:Parameter DefaultValue="course" Name="Course" Type="String" /> </SelectParameters> </asp:SqlDataSource> </form> </body> </html>Mary1
0 Points
9 Posts
Re: Comparing DropDownList value and GridView value in specific column
Jan 26, 2013 12:22 PM|LINK
I called that in ParametrizedQuery(), you could see that on previous code.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Comparing DropDownList value and GridView value in specific column
Jan 26, 2013 11:32 PM|LINK
Hi,
Please debug your cellValue and SelectedItem.Value to see their values.
Mary1
0 Points
9 Posts
Re: Comparing DropDownList value and GridView value in specific column
Jan 27, 2013 07:12 PM|LINK
It's working now. Thank you Decker Dong!