ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
How can we read a columnised text data in ASP.Net C#? 
Columnised means my data is stored in a text file and I 
have numeric data or string data in this file. For ex. If I 
am searching for the data of gender and I know that gender 
data is stored at column 32 in text file. How can I get 
this data in ASP.Net page. Thanks for help in advance.
 Question Submitted By :: Abhinavsaxena24
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How can we read a columnised text data in ASP.Net C#? Columnised means my data is stored in a text file and I have numeric data or string data in this file. For ex. If I am searching for the data of gender and I know that gender data is stored at column 32 in text file. How can I get this data in ASP.Net page. Thanks for help in advance.
Answer
# 1
we need that text file convert into integer for example 
cint(Textbox1.text)..
 
Is This Answer Correct ?    5 Yes 4 No
Sandeep Kumar Shaw
 
  Re: How can we read a columnised text data in ASP.Net C#? Columnised means my data is stored in a text file and I have numeric data or string data in this file. For ex. If I am searching for the data of gender and I know that gender data is stored at column 32 in text file. How can I get this data in ASP.Net page. Thanks for help in advance.
Answer
# 2
string OpenPath, contents;
            int tabSize = 4;
            string[] arInfo;
            string line;
            DataTable table = CreateTable();
            DataRow row;
            try
            {

                OpenPath = Server.MapPath(".") + @"\My
File.log";
                string FILENAME = OpenPath;
                //Get a StreamReader class that can be used
to read the file
                StreamReader objStreamReader;
                objStreamReader = File.OpenText(FILENAME);
                while ((line = objStreamReader.ReadLine())
!= null)
                {
                    contents =
line.Replace(("").PadRight(tabSize, ' '), "\t");


                    // define which character is seperating
fields
                    char[] textdelimiter = { ']' };

                    arInfo = contents.Split(textdelimiter);
                    for (int i = 0; i <= arInfo.Length; i++)
                    {
                        row = table.NewRow();
                        if (i < arInfo.Length)
                            row["Type"] =
arInfo[i].ToString().Replace("[", " ");

                        if (i + 1 < arInfo.Length)
                            row["Source"] = arInfo[i +
1].ToString().Replace("[", " ");
                        if (i + 2 < arInfo.Length)
                            row["Time"] = arInfo[i +
2].ToString().Substring(1);
                        if (i + 3 < arInfo.Length)
                        {
                            row["Description"] = arInfo[i +
3].ToString().Replace("[", " ");
                            table.Rows.Add(row);
                        }
                        i = i + 2;
                    }
                }
 
Is This Answer Correct ?    0 Yes 1 No
Praveen Kumar
 
 
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
Define Query Interface,Adref,Release? Microsoft1
What does the "EnableViewState" property do? Why would I want it on or off?  3
What is the difference of a LEFT JOIN and an INNER JOIN statement? What is a Cartesian product? What causes it? Syntax-Softtech1
What is JIT, what are types of JITS and their purpose ? Infosys3
How do I debug an ASP.NET application that wasn't written with Visual Studio.NET and that doesn't use code-behind?  1
What tag do you use to add a hyperlink column to the DataGrid?  1
Which tools of web site Administartion tool do you use to manage user,roles and rules?  2
can i use two web.config files of ConnectionString in One Default.aspx page Verinon-Technology-Solutions5
How to Insert a TextBox value in to Sql database using C# coding? Sona6
what is dumpbin.exe?  1
Why Global.asax is used? Perot-Systems6
One of the properties of the Web Part has an incorrect format. Windows SharePoint Services cannot deserialize the Web Part. Check the format of the properties and try again. - this error is occured in Sharepoint 2007 while deploy the web part WebInfo1
What is SQL injection?  1
What method must be overridden in a custom control? a) The Paint() method b) The Control_Build() method c) The Render() method d) The default constructor Syntax-Softtech1
hi everyone. can anyone send me wipro interview questions on .net. plz its urgent Wipro1
Your ASP.NET application displays sales data on a page. You want to improve performance by holding the page in memory on the server for one hour. You want to ensure that the page is flushed from memory after one hour, and that the page is re-created when the next request for the page is received. What should you do? A . Initialize a new instance of the Cache class in the Application.Start event handler. B . Initialize a new instance of the Timer class in the Page.Load event handler. C . Set the Duration attribute of the OutputCache directive in the page. D . In the Web.config file, set the timeout attribute of the sessionState element. Syntax-Softtech5
Is it possible to disable the minimized icon of a popup window using window.open. Not using iframe concept? Take-United2
What is the difference between Postback and Ispostback Property? HCL2
Difference between .NET and previous version? Microsoft1
To which side ( server ? client) does the user input data validation occur? Explain the reasons for it?  1
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com