User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 423,637 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,215 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 524 | Replies: 4
Reply
Join Date: Jul 2008
Posts: 2
Reputation: vatsala is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vatsala vatsala is offline Offline
Newbie Poster

store files in database

  #1  
Jul 18th, 2008
hi friends
i have to store and read .txt files from database(sqlserver 2005) using asp.net 2.0
and i m unable to do that
plzz reply me as soon as possible
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2007
Posts: 257
Reputation: greeny_1984 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 10
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz in Training

Re: store files in database

  #2  
Jul 19th, 2008
hi,
do u have any folder in which u save the txt files,r from database.
Reply With Quote  
Join Date: Jul 2008
Posts: 2
Reputation: vatsala is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vatsala vatsala is offline Offline
Newbie Poster

Re: store files in database

  #3  
Jul 20th, 2008
hi
first of all thanx for being there to help me out..
actually my main problem is that i have to read a txt file stored somewhere in my computer and its path is specified in the database
i dnt know how read this using asp.net 2.0
plzz help me
Reply With Quote  
Join Date: Jun 2008
Posts: 5
Reputation: dvlpr30062 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
dvlpr30062 dvlpr30062 is offline Offline
Newbie Poster

Re: store files in database

  #4  
Jul 20th, 2008
You may want to try something like this:

    public void Button1_OnClick(object sender, EventArgs e)
    { 

        string path = TextBox1.Text.ToString();
        string file = TextBox2.Text.ToString();
        DirectoryInfo dir = new DirectoryInfo(path);
        FileInfo[] bmpfiles = dir.GetFiles(file);
        foreach( FileInfo f in bmpfiles)
        {
            //add what you need to do with the file when found
            Label1.Text = "File Found";
        }
    }

I am reading from text boxes, in a similar fashion I think you can read from a database through your database connection, etc. This does require "using System.IO;"

I hope this helps.
Reply With Quote  
Join Date: Jun 2008
Posts: 5
Reputation: dvlpr30062 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
dvlpr30062 dvlpr30062 is offline Offline
Newbie Poster

Re: store files in database

  #5  
Jul 20th, 2008
I forgot to mention that I did this in C# on the aspx.cs.

I am sure it can be translated to another language if C# is not the language of preference.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 10:09 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC