asp.net - Gridview DataSourceID with Multiple Datasources? -
I would like to display clickable news headlines but I'm having trouble pulling data from two data sources for a single gridview is. I'm trying to do this DataSourceID = "SqlDataSource1, SqlDataSource2" but that's not working Thanks in advance.
& asp: gridview id = "gridview1" run = "server" automatically generated column = "incorrect" datasource id = "SqlDataSource1, SqlDataSource2" & gt; & Lt; Columns & gt; & Lt; ASP: Hyperlinkfield datatffield = "NewsHeadline" dataNavigateAurilfield = "NewsRule" /> & Lt; / Column & gt; & Lt; / ASP: GridView & gt; & Lt; Asp: SqlDataSource id = "SqlDataSource1" runat = "server" connectionstring = "& lt;% $ connectionSettings: connectionServing1%>" Provider name = "& lt;%% connection accepted: connection estring 1. provider name% & gt;" SelectCommand = "Select [NewsTable] from [News-Headline] & gt; & Lt; / ASP: SQLDataSource & gt; & Lt; Asp: SqlDataSource id = "SqlDataSource2" runat = "server" connectionstring = "& lt;% $ connectionSetting: connection string1%>" Provider name = "& lt;%% connection accepted: connection estring 1. provider name% & gt;" SelectCommand = "SELECT [NewsURL] [NewsTable]" & gt; & Lt; / ASP: SQLDataSource & gt;
single control can not use multiple sources
you Create a custom data source control that accepts two data sources and produces output from both of them.
Comments
Post a Comment