473,396 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Add a list stored in a text file to a SQL Server 2005 database

Hi I am coding an ASP .Net project in C# and am using connection strings to connect to a Microsoft SQL Server 2005 database, and the project involves tracking student attendance records at a university.

I have a table for each class in the uni, and the only field is StudentNumber. Whenever an admin wants to add a new module, a new table is created, and then whenever he wants to add students to that class table he has to currently add each student number to the table individually.

I am looking for a way so that if an admin has a list of student numbers in a text file, he can just submit this text file to my application and the C# will parse this text file and add each individual student number to this table.

Does anybody know any SQL commands that will let me do this or know how I can get the application to ask the user to submit a file?
Apr 21 '08 #1
2 998
Mr Gray
47
You can use one of these asp server controls:

Expand|Select|Wrap|Line Numbers
  1. <asp:FileUpload ID="fileStudentList" runat="server" />
  2.  
then the file you upload you can search through the list of numbers and maybe turn them into an array:

Expand|Select|Wrap|Line Numbers
  1. file.contents.Split(",");
  2.  
the last bit of code is only to demonstrate what you could do it is not actually correct.

Best bet is search for the fileupload asp control and learn how that works then learn how to manipulate the contents of that file using the String class and also as another point look into the System.IO namespace and learn what that can do for you as those are the parts I would use to do something like what you are suggesting.
Apr 21 '08 #2
cheers that sounds like what I need, will look into it now
Apr 21 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Wysiwyg | last post by:
I was hoping to get some opinions on the efficiency of various methods of reusing the same dropdown list data. Here is the situation: Multiple panels on maintenance pages with TAB menus across...
6
by: SandySears | last post by:
I am trying to use a stored procedure to insert a record using VS 2005, VB and SQL Server Express. The code runs without errors or exceptions, and returns the new identifer in the output...
1
by: mickyang | last post by:
My MS-SQL 2000 Database have 50 more Stored Procedure . How to FAST and EASY ENCRYPTION ALL Stored Procedure in my MS-SQL Database?
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
11
by: eureka | last post by:
Hi All, I'm training in Servlets, JSP and JavaScript, I have a web page in which there's a "StudentName" textbox and below it is a "Names" Dropdown list. Initially the Textbox is empty and...
7
by: mkarbarz | last post by:
Hello, I need to come up with a stored procedure that will allow me to read data from another database. The database I need to read the data from is a UniData residing on a Unix server. The...
1
by: sheenaa | last post by:
Hello Members, I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005. What i have used on forms :: ? On my first form i have used some...
2
by: pozze | last post by:
Hi, I need to display images and other record information retrieved from an SQL 2005 database in a datagrid on a web page. I'm coding in VB .net I have recently changed over from VB ASP and i'm...
1
by: moorcroft | last post by:
Hi I am coding an ASP .Net project in C# and am using connection strings to connect to a Microsoft SQL Server 2005 database, and the project involves tracking student attendance records at a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.