Search code examples
asp.netgridviewsearch-enginedataview

Error( the type or namespace name Data View could not be found)


adsSearch.FilterExpression = string.Format("[Product Title] = '{0}'", TextBox1.Text);

    DataView dv = (DataView)adsSearch.Select(DataSourceSelectArguments.Empty);

    if (dv.Count > 0)
    {
        args.IsValid = false;
    }
    else
    {
        args.IsValid = true;
    }

The error (the type or namespace name Data View could not be found). I m trying to do a search engine to search item in database and display the output in a gridview after the user type keyword into a textbox and search through database for similar product title keyword. how to solve this error? i m using visual studio 2008 express c# to do the website. after the dataview been solved ,what condition should i put for the code

if (Page.IsValid) { Condition; }


Solution

  • You probably need to add Using System.Data; to the top of your file