User Profile

Collapse

Profile Sidebar

Collapse
Mr Gray
Mr Gray
Last Activity: Oct 19 '08, 10:50 PM
Joined: Apr 7 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thanks for your reply.

    I convert the contents into text and split on the '|' character. Each split will then map to a column in my DB. I have managed to get the contents as text and can send this to the db using SqlParameters but I would really like an example of the MemoryStream taking the byte[] and reading it as meaningful text so i can do the split without having to create a temporary file.

    So if possible can you...
    See more | Go to post

    Leave a comment:


  • I can now GET the file but i have to save it to disk first - do I have to save it to disk or cannot i not do it all in memory?
    See more | Go to post

    Leave a comment:


  • Mr Gray
    replied to Give permission to the users
    in .NET
    You can check the user by:

    Code:
    IPrincipal user = Page.User;
    Then you can check that the user is in a specific group like so:

    Code:
    string strRoleToCheck = "Administrator"; // could be what ever group you need to give permission to.
    user.IsInRole(strRoleToCheck)
    See more | Go to post

    Leave a comment:


  • C# - Read a file from FTP and save the contents in SQL Server

    Hi Guys,

    My requirement is to scan an FTP directory for the presence of 4 files and if a specific file exists I can begin to GET those files, read the contents and save the contents into an SQL 2005 DB.

    The files are of a fixed length format which map to certain elements of data that my database will exploit. If i can learn to read 1 file and put the contents into the DB then I can do the other 3 on my own.
    ...
    See more | Go to post

  • Using the StreamReader and possibly TestReader classes in the System.IO namespace can help.

    Code:
                StreamReader sr = new StreamReader("c:\textSource.txt");
                StreamWriter sw = new StreamWriter("c:\textDestination.txt");
    
                sw.Write(sr.ReadToEnd());
    See more | Go to post

    Leave a comment:


  • Mr Gray
    started a topic C# 3.0 2008 Win Form Combo Box Runtime Adding
    in .NET

    C# 3.0 2008 Win Form Combo Box Runtime Adding

    HI guys,

    I am developing a winform and need to update the contents of a combo box at runtime. I currently click a button that brings up a new dialog and click save. I then return to the parent form and at that point i rebind the combo box to the collection that retrieves my new saved item from the DB. Problem is that i can see the item when I debug and step through but the combo box has not been refreshed to show the new item.
    ...
    See more | Go to post

  • Mr Gray
    replied to From ASP.NET to VB.NET
    in .NET
    ASP.NET is a subset of the .NET framework VB.NET is a language used to write .NET code and as ASP.NET is a subset, VB.NET is also used to write ASP.NET.

    Do you have to use frames? If you look at master pages instead of using frames the web site can be controlled much easier and in a less out of date way. I can help you further if you need a little tutorial in the master page topic just message me.
    See more | Go to post

    Leave a comment:


  • Mr Gray
    started a topic IIS : Moving Site Off SPS
    in IIS

    IIS : Moving Site Off SPS

    I have a site that is running on a SPS 2003 box and I intend to remove it from that box and off any sharepoint architecture. I currently receive the following error and I am inclined to think it is something to do with not being on the SPS box anymore where SPS would normally take control of permissions amongst other things.

    Code:
    Server Error in '/' Application.
    --------------------------------------------------------------------------------
    ...
    See more | Go to post

  • Mr Gray
    replied to From ASP.NET to VB.NET
    in .NET
    in the code behind use in the page load event

    Code:
    Response.Redirect("Tree.aspx")
    See more | Go to post

    Leave a comment:


  • Mr Gray
    replied to how to get browser detail in Winform
    in .NET
    this seems to be a javascript one:

    Code:
    top.location.href;
    or in C#

    Code:
    Request.Url;
    is what you need
    See more | Go to post

    Leave a comment:


  • Mr Gray
    replied to retrive image from database to grid using C#
    in .NET
    I have done this a few times before and searched google as I knew there would be plenty of articles about this and I found this:

    http://www.aspfree.com/c/a/ASP.NET/R...--C---Part-II/

    Seems to be quite useful....
    See more | Go to post

    Leave a comment:


  • Mr Gray
    replied to numbers and a full stop regular expression
    in .NET
    Look at:

    http://regexlib.com/

    It is a great place to learn Regular Expression and search for ones that may fit what you need....
    See more | Go to post

    Leave a comment:


  • You can use one of these asp server controls:

    Code:
    <asp:FileUpload ID="fileStudentList" runat="server" />
    then the file you upload you can search through the list of numbers and maybe turn them into an array:

    Code:
    file.contents.Split(",");
    the last bit of code is only to demonstrate what you could do it is not actually correct....
    See more | Go to post

    Leave a comment:


  • Mr Gray
    replied to How to Stop a Running Thread
    in .NET
    Also what type of files are they?
    See more | Go to post

    Leave a comment:


  • Mr Gray
    replied to How to Stop a Running Thread
    in .NET
    Is it possible for you to do a dos copy if the files are on disc? Then unless the machine actually has the plug pulled the files will be copied and you will not have any corruption problems.
    See more | Go to post

    Leave a comment:


  • Mr Gray
    replied to .NET 2.0 AppPool Error 80070569
    in IIS
    Found the solution to my Woes by adding the account that the appPool uses as its identity to the local policy: 'Log on as batch job'

    This fixed my problem.
    See more | Go to post

    Leave a comment:


  • Mr Gray
    started a topic .NET 2.0 AppPool Error 80070569
    in IIS

    .NET 2.0 AppPool Error 80070569

    I am trying to install a website that is running successfully on one server but not on the server I am currently trying to run it on. I have created a new website on the server and have added the web files to the web site and set up an appPool to run the web site in.

    The problem i get is: 80070569

    Where the account I use (and can verify on the domain) is not verified on the server, please can someone tell me why this...
    See more | Go to post

  • Mr Gray
    replied to validation expression help
    in .NET
    add (?-i) to the front of the expression should set case sensitive OFF:

    Code:
    (?-i)<expression>
    let me know if you have any more problems...
    See more | Go to post

    Leave a comment:


  • Mr Gray
    replied to ASP:ListBox PostBack
    in .NET
    Well javascript/ajax is used to avoid posting back so if you want to manipulate the list you need to decide if you want to post back or not.

    If you don't want to post back then you require ajax.
    See more | Go to post

    Leave a comment:


  • Mr Gray
    replied to How to Stop a Running Thread
    in .NET
    How are you implementing this? I have a multi thread app that basically reads a db table that has 'jobs' to run and loads only 2 at a time in a delegate that fires-and-forgets.

    This way you app can queue up the 'jobs' and have a service/app of some kind read from the queue and execute each job one after the other.

    If the process is not complete the row will still remain in the db table otherwise the 'job' is removed...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...