Click here to Skip to main content
15,921,660 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: datalist with linkbutton Pin
nick neutron3-Dec-06 8:54
nick neutron3-Dec-06 8:54 
QuestionManipulating Response Headers Pin
Dominic Pettifer2-Dec-06 7:29
Dominic Pettifer2-Dec-06 7:29 
AnswerRe: Manipulating Response Headers Pin
Guffa2-Dec-06 9:12
Guffa2-Dec-06 9:12 
QuestionImage in dataview problem Pin
Imran Khan Pathan2-Dec-06 2:35
Imran Khan Pathan2-Dec-06 2:35 
QuestionUploading Sql Database Pin
Ashish Porwal2-Dec-06 1:39
Ashish Porwal2-Dec-06 1:39 
AnswerRe: Uploading Sql Database Pin
jszulc2-Dec-06 1:59
jszulc2-Dec-06 1:59 
QuestionActive Report and Email Sending? Pin
Tridip Bhattacharjee2-Dec-06 1:38
professionalTridip Bhattacharjee2-Dec-06 1:38 
QuestionDropDownList Serach not showing what stored procedure displays during run Pin
jszulc2-Dec-06 1:38
jszulc2-Dec-06 1:38 
I am trying to construct "advanced serach" page where user can select choices from multiple dropdown lists and then when Search button is pressed the results are being displayed in a gridView. When I run the sproc below manually results are perfect, I can pass no parameter, 1 parameter or 2 . The output is correct in a standard SQL Query. For some reason in aspx the serach works only if 2 dropdownchoices are selected, I tried to select only 1 choice and search resulted in 0 rows. I believe problem lays somewhere in Default Value or pasing null. Can someone shed light on this problem. I need to be able to run this search for any dropdown list selected.


here is my G Wells sproc with coalesce:
ALTER proc sp_gwells
@DCSTANDALONE varchar(8000) = null,
@STAGE varchar(8000) = null
as
begin
select SERVER_NAME,[Team Member],DC/STANDALONE],SRM,STAGE,DECOMMSTATUS
from DecommMaster
where [DC/STANDALONE] = coalesce(@DCSTANDALONE,[DC/STANDALONE])
and STAGE = coalesce(@STAGE,STAGE)
end
*******************************************ASPX below*************

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" CodeFile="SearchC.aspx.cs" Inherits="DeleteConfirm" Title="Untitled Page" %>



protected void Button1_Click(object sender, EventArgs e)
{
SqlDataSource3.Select(DataSourceSelectArguments.Empty);
GridView1.AllowPaging = false;
GridView1.DataBind();

int rowcount = GridView1.Rows.Count;
GridView1.AllowPaging = true;
lblRowCount1.Text = rowcount.ToString() + " Rows Found!";
}


<asp:content id="Content1" contentplaceholderid="ContentPlaceHolder1" runat="Server">
 
<asp:label id="Label1" runat="server" text="DCO/NON-DCO:" width="119px"> <asp:dropdownlist id="DropDownList1" runat="server" datasourceid="SqlDataSource1"
="" datatextfield="column1" datavaluefield="column1" appenddatabounditems="true">
<asp:listitem text="Select" value="">
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:DECOM_DataConnectionString1 %>"
="" selectcommand="SELECT DISTINCT [DC/STANDALONE] AS column1 FROM [DecommMaster]">
<asp:label id="Label2" runat="server" text="STAGE:"> <asp:dropdownlist id="DropDownList2" runat="server" datasourceid="SqlDataSource2"
="" datatextfield="STAGE" datavaluefield="STAGE" appenddatabounditems="true">
<asp:listitem text="Select" value="">
<asp:sqldatasource id="SqlDataSource2" runat="server" connectionstring="<%$ ConnectionStrings:DECOM_DataConnectionString1 %>"
="" selectcommand="SELECT DISTINCT [STAGE] FROM [DecommMaster]">
<asp:button id="Button1" runat="server" onclick="Button1_Click" text="Search">

<asp:label id="lblRowCount1" runat="server" width="129px">

<asp:button id="Button2" runat="server" onclick="Button2_Click" text="Export To Excel">

<asp:gridview id="GridView1" runat="server" cellpadding="3" datasourceid="SqlDataSource3"
="" forecolor="#333333" gridlines="None" allowpaging="True">
<footerstyle backcolor="#5D7B9D" font-bold="True" forecolor="White">
<rowstyle backcolor="#F7F6F3" forecolor="#333333">
<editrowstyle backcolor="#999999">
<selectedrowstyle backcolor="#E2DED6" font-bold="True" forecolor="#333333">
<pagerstyle backcolor="#284775" forecolor="White" horizontalalign="Center">
<headerstyle backcolor="#5D7B9D" font-bold="True" forecolor="White">
<alternatingrowstyle backcolor="White" forecolor="#284775">

<asp:sqldatasource id="SqlDataSource3" runat="server" connectionstring="<%$ ConnectionStrings:DECOM_DataConnectionString1 %>"
="" selectcommand="sp_gwells" selectcommandtype="StoredProcedure">
<selectparameters>
<asp:controlparameter controlid="DropDownList1" name="DCSTANDALONE" propertyname="SelectedValue"
="" type="String" defaultvalue="">
<asp:controlparameter controlid="DropDownList2" name="STAGE" propertyname="SelectedValue"
="" type="String" defaultvalue="">



QuestionJavascript Problem Pin
monika_vasvani2-Dec-06 1:15
monika_vasvani2-Dec-06 1:15 
AnswerRe: Javascript Problem Pin
Guffa2-Dec-06 4:55
Guffa2-Dec-06 4:55 
AnswerRe: Javascript Problem Pin
K.P.Kannan2-Dec-06 13:48
K.P.Kannan2-Dec-06 13:48 
QuestionDynamic selectcommand and paging/sorting Pin
MarkLF2-Dec-06 0:29
MarkLF2-Dec-06 0:29 
QuestionData Access Pin
Shriya Kapoor1-Dec-06 23:23
Shriya Kapoor1-Dec-06 23:23 
AnswerRe: Data Access Pin
Bassam Saoud2-Dec-06 1:16
Bassam Saoud2-Dec-06 1:16 
QuestionFrom Child browser to Parent browser Pin
indian1431-Dec-06 23:10
indian1431-Dec-06 23:10 
GeneralRe: From Child browser to Parent browser Pin
Guffa2-Dec-06 8:35
Guffa2-Dec-06 8:35 
GeneralFrom Child browser to Parent browser Pin
indian1433-Dec-06 18:01
indian1433-Dec-06 18:01 
GeneralRe: From Child browser to Parent browser Pin
Guffa3-Dec-06 19:24
Guffa3-Dec-06 19:24 
QuestionFor communication between child browser to parent browser [modified] Pin
indian1431-Dec-06 23:01
indian1431-Dec-06 23:01 
Questionhow to read values UserControl Valuse(textBox) from the datagrid? Pin
nabeelkhan1-Dec-06 22:56
nabeelkhan1-Dec-06 22:56 
QuestionCommunication between child browser to parent browser Pin
indian1431-Dec-06 22:50
indian1431-Dec-06 22:50 
QuestionRead PST File Pin
aaraaayen1-Dec-06 20:14
aaraaayen1-Dec-06 20:14 
AnswerRe: Read PST File Pin
Vasudevan Deepak Kumar1-Dec-06 20:56
Vasudevan Deepak Kumar1-Dec-06 20:56 
QuestionDataList's OnItemCreated events get called without page load event..! Need Help Pin
Sachin Pawar A.1-Dec-06 19:52
Sachin Pawar A.1-Dec-06 19:52 
QuestionHow to make a progress bar?? Pin
miss_neha_mishra1-Dec-06 19:43
miss_neha_mishra1-Dec-06 19:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.