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...
User Profile
Collapse
-
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?Leave a comment:
-
You can check the user by:
Then you can check that the user is in a specific group like so:Code:IPrincipal user = Page.User;
Code:string strRoleToCheck = "Administrator"; // could be what ever group you need to give permission to. user.IsInRole(strRoleToCheck)
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.
... -
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());Leave a comment:
-
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.
... -
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.Leave a comment:
-
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. --------------------------------------------------------------------------------
-
in the code behind use in the page load event
Code:Response.Redirect("Tree.aspx")Leave a comment:
-
this seems to be a javascript one:
or in C#Code:top.location.href;
is what you needCode:Request.Url;
Leave a comment:
-
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....Leave a comment:
-
Look at:
http://regexlib.com/
It is a great place to learn Regular Expression and search for ones that may fit what you need....Leave a comment:
-
You can use one of these asp server controls:
then the file you upload you can search through the list of numbers and maybe turn them into an array:Code:<asp:FileUpload ID="fileStudentList" runat="server" />
the last bit of code is only to demonstrate what you could do it is not actually correct....Code:file.contents.Split(",");Leave a comment:
-
-
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.Leave a comment:
-
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.Leave a comment:
-
.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... -
add (?-i) to the front of the expression should set case sensitive OFF:
let me know if you have any more problems...Code:(?-i)<expression>
Leave a comment:
-
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.Leave a comment:
-
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...Leave a comment:
No activity results to display
Show More
Leave a comment: