Vistual Studio ASP.NET 2.0 SQlDataSource question

Discussion in 'Software' started by be0, Aug 21, 2008.

  1. be0

    be0 Corporal

    Hi eveyrone,

    I am just wondering if this is possible. I am obviously doing something wrong:

    I have a SQl Data source and I am trying to dynamicaly determine a SQL query for it based on webpage choices. Then I have a GridView assigned to the above SQL SQLDataSource.

    Here is my code: Select command is not working for me. It has something to do with the "" or <% %> but I cannot figure it out.

    <asp:SqlDataSourceID="SQDataSource"runat="server"
    ConnectionString="<%$ ConnectionStrings:MacConn %>"

    SelectCommand=<%Response.Write(SQL);%>>

    </asp:SqlDataSource>
     
  2. Kodo

    Kodo SNATCHSQUATCH

    use the either the page_load event or the sqldatasource selecting event to tap into the sql datasource and change the query at runtime.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds