Click here to Skip to main content
15,899,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

How to Upload Notepad Data Into GridView in Asp.net web Application

in Notepad data is like this

x y z
168.68 169.69 7.41
169.77 165.22 5.41
200.00 100.00 10.0


i want this x y z values in griedview in asp.net web application how to do code?

in notepad no column names directly data is there.
Posted
Updated 30-May-13 1:16am
v3
Comments
Suvabrata Roy 30-May-13 2:48am    
Please elaborate ...
MAKReddy 30-May-13 3:08am    
i have a notpad data like

168.68 169.69 7.41 like x y z

i want this x y z values in griedview in asp.net web application
Amey K Bhatkar 30-May-13 4:04am    
i done in windows but i want in web application.
If you done in windows then you can use same code in web.
What is the problem there?

1 solution

Try below mentioned code

C#
string [] dataSource= File.ReadAllLines(@"C:\data.txt");
        GridView1.DataSource = dataSource;
      GridView1.DataBind();
 
Share this answer
 
Comments
Mahesh Bailwal 30-May-13 7:06am    
are you getting any error?
MAKReddy 30-May-13 7:22am    
Thanks now i got it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900