Dear All
Having this error coming.
I tried to change the undernoted to GridView1.DataSourceID =
dsas
but it gave an error.
I also tried to change
<pre> AutoGenerateColumns="False" BackColor="#FFFFCC" DataSourceID="SqlDataSource1"
to <pre> AutoGenerateColumns="False" BackColor="#FFFFCC" DataSource="SqlDataSource1"
and it also was no ok.
What do I do to resolve this issue?
*************************************
<pre> <td class="style32" colspan="8">
<div style="height: 80px; text-align: left;" align="center">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" BackColor="#FFFFCC" DataSourceID="SqlDataSource1"
Font-Overline="False" Font-Size="X-Small" ForeColor="Black"
onselectedindexchanged="GridView1_SelectedIndexChanged" PageSize="5"
style="margin-right: 91px" Width="918px">
***************************************
public void LoadSearch()
{
try
{
SqlConnection connect = new SqlConnection();
connect.ConnectionString = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
connect.Open();
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM LOANS order by ID_CODE", connect);
SqlCommand SqlCmd = new SqlCommand("sp_searchActLoan", connect);
SqlCmd.CommandType = CommandType.StoredProcedure;
SqlCmd.Parameters.AddWithValue("@searchString", txt_Search.Text);
SqlCmd.ExecuteNonQuery();
SqlDataAdapter daa = new SqlDataAdapter();
daa.SelectCommand = SqlCmd;
DataSet dsas = new DataSet();
daa.Fill(dsas, "searchResults");
GridView1.DataSource = dsas;
//GridView1.DataSourceID = null;
GridView1.DataSource = dsas;
GridView1.DataBind();
connect.Close();
------------------------------------------
------------------------------------------