[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

postback SqlDataSource

Posted on 2009-07-07
3
Medium Priority
?
559 Views
Last Modified: 2013-12-17
I am using the following ASP to connect to my database and populate my FormView.

I only want to do this when the page  is  NOT postback. How can I do this?

Here is the asp

 <asp:SqlDataSource ID="PeerAssementDB" runat="server"
        ConnectionString="<%$ ConnectionStrings:ReferralConnectionString %>"
        SelectCommand="spGeteerReviewMonthlyAll" SelectCommandType="StoredProcedure"
        UpdateCommand="spUpdateeerReviewMonthly" UpdateCommandType="StoredProcedure">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList_SpecDescription" Name="Spec_Desc"
                PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="DropDownList_Status" Name="Status"
                PropertyName="SelectedValue" Type="String" />
            <asp:QueryStringParameter DefaultValue="P8" Name="OrgCode"
                QueryStringField="OrgCode" Type="String" />
        </SelectParameters>
0
Comment
Question by:Mr_Shaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
muktou earned 2000 total points
ID: 24795794
The Sql Datasource should bind at run time. When the page is not postback then you can bind SQL database with the formview in page load event. like

Page_Load()
{
If(Page.IsPostBack)
{
formview1.DataSource = SQLdatasource1;
formview1.Databind();
}

0
 
LVL 1

Expert Comment

by:muktou
ID: 24795805
formview1.DataSource = SQLdatasource1; please igore this statement and use following statement:

formview1.DataSource = "SQLdatasource1";
0
 

Author Closing Comment

by:Mr_Shaw
ID: 31600672
thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question