• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 815
  • Last Modified:

Namespace name "DataView" could not be found.

I am trying a different approach to my issue.

How do I resolve this error -  "Namespace name "DataView" could not be found."

 <asp:TextBox runat="server" ID="txtAuthors" Text='<%# Bind("AuthorName") %>' />
        <asp:ImageButton runat="server" ID="btnFindAuthors"  OnClick="btnFindAuthors"/>
<asp:SqlDataSource runat="server" ID="sqlAuthors" ConnectionString="<%$ ConnectionStrings:Libros %>" ProviderName="<%$ ConnectionStrings:Libros.ProviderName %>" 
        SelectCommand="SELECT * FROM AuthorNames ORDER BY AuthorName" 
        InsertCommand="GET_AuthorNames" InsertCommandType="StoredProcedure">
            <asp:ControlParameter ControlID="txtAuthorName" Name="authorname" />

     <asp:GridView runat="server" ID="gvAuthors" DataSourceID="sqlAuthors" DataKeyNames="AuthorID" AutoGenerateColumns="false">
                <asp:HyperLinkField HeaderText="Author Name" DataNavigateUrlFormatString="~/Author_Details.aspx?id={0}" DataNavigateUrlFields="AuthorID" DataTextField="AuthorName" />
                <asp:BoundField DataField="AuthorID" HeaderText="AuthorID" Visible = "False" />

Open in new window

 protected void btnFindAuthors(Object sender, EventArgs e)
        DataView DV = new DataView(authorid);
        DV.RowFilter = string.Format("AuthorName LIKE '%{0}%'", txtAuthorName.text);
        gvAuthors.DataSource = DV;

Open in new window

My .axms page does include this:
using System.Data;  

Open in new window

  • 2
2 Solutions
Jacques Bourgeois (James Burger)PresidentCommented:
Try specifying the namespace in your declaration:

System.Data.DataView DV = new System.Data.DataView(authorid);
programmherAuthor Commented:
This resolved the error:  <%@ Import Namespace="System.Data" %>
programmherAuthor Commented:
I used both solutions and they resolved the error.  All points awadred to JamesBurger
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now