We help IT Professionals succeed at work.
Get Started

Can you use a text file as a data source for a GridView in ASP

btkrieger asked
Last Modified: 2015-04-16

I have a working ASP page that is pulling data from a SQL table into a Gridview with a select statement.  I would like to do the same thing using a text file vs the SQL table as my data source.  Is this possible to create a system DSN and connect to the text file to pull my data? If not can you point me into the right direction?

Current Web.cofig
<add name="FBConnectionString" connectionString="Data Source=FORTISBLUE2008\SQLEXPRESS;Initial Catalog=YourLookup;User ID=blue;Password=blue;Connect Timeout=200" providerName="System.Data.SqlClient" /> --%>

Current asp page:

 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:FBConnectionString %>" SelectCommand="SELECT * FROM dbo.APInvoice WHERE VendorName LIKE @VName">
        <asp:ControlParameter ControlID="tbVName" Name="VName" PropertyName="Text" />
Watch Question
Web Ninja at large
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE