473,500 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to set a parameter as a text file

44 New Member
Hi everyone i am slowly learning a bit of asp and I have managed to make a TextBox value update a column in a table.

What I would now like it to do is, rather than the parameter being the TextBox, is to update the table based on a text file from my desktop.

Here is my asp so far. How should i go about approaching this.

Thanks for any help in advance.
Expand|Select|Wrap|Line Numbers
  1. <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
  2.         <br />
  3.         <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1">
  4.         </asp:DataList>
  5.         <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
  6.             ConnectionString="<%$ ConnectionStrings:bookConnectionString %>" 
  7.             InsertCommand="InsertInToIntTableStoredProcedure" 
  8.             InsertCommandType="StoredProcedure" 
  9.             SelectCommand="InsertInToIntTableStoredProcedure" 
  10.             SelectCommandType="StoredProcedure">
  11.             <InsertParameters>
  12.                 <asp:Parameter Name="ProdID" Type="Int32" />
  13.             </InsertParameters>
  14.             <SelectParameters>
  15.                 <asp:ControlParameter ControlID="TextBox1" Name="ProdID" PropertyName="Text" 
  16.                     Type="Int32" />
  17.             </SelectParameters>
  18.         </asp:SqlDataSource>
Also after playing with what i currently have why do i have to have the datalist bit to make this to work?
Expand|Select|Wrap|Line Numbers
  1. <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1">
  2.         </asp:DataList>
Apr 2 '12 #1
3 1901
Frinavale
9,735 Recognized Expert Moderator Expert
You would need to have the user select the text file to upload to the server.

The server would then have to take the necessary steps to validate the file uploaded and then read from the text file in order to update your database.

Or if you are planning on just storing the text file into the database, you could skip the reading part.

-Frinny
Apr 3 '12 #2
315hughes
44 New Member
I will just be attempting to store the values of the text file into a database. will i need to do this in the VB code behind?
Apr 3 '12 #3
Frinavale
9,735 Recognized Expert Moderator Expert
Yes you will have to do this in your server-side code.
This is business logic and cannot be handled automatically for you.

-Frinny
Apr 3 '12 #4

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

Similar topics

2
12066
by: Mark Anderson | last post by:
Hi, I've a problem with code that should produce a Windows(ANSI) encoded text file but doesn't. Server is IIS 5 on Win 2k, with ASP ver? My ASP uses data from an upstream HTML form on a UTF-8...
2
21506
by: Rudolf Bargholz | last post by:
Hi, DB2 Version 7.1 FP11 on Windows XP I have a text file containing SQL. The text file was created using db2look. CONNECT TO MYDB user db2admin using xxxxxx;
1
12192
by: Andrew Chanter | last post by:
I am writing a little routine to perform the following operations from an Acces 97 mdb: 1. create a fixed width text file 2. create/establish a table type link to the text file in Access 3....
4
2110
by: Stuk | last post by:
Hi, im false beginner in C so that`s why im writting here :). I have to write a Text Reformater, which should read data from text file every Verse. In text file may appear special directives (for...
1
10761
by: TJ | last post by:
I am very new to C# (this is my first real project), therefore please be patient if my question is considered being to newbie. I am modifying a program which takes a text file, does some...
11
19811
by: scorpion53061 | last post by:
Well I had a way to write an array to an excel spreadsheet but on a huge time critical run it failed iwth the dreaded HRESULT: 0x800A03EC error. It worked fine when i sampled the data to go in but...
17
1990
by: J.S. | last post by:
I have a text file with parameters like the following embedded in the text: @@TextBox1@@, @@TextBox2@@, etc. I know how to read this text file. However, I am trying to figure out how to...
1
1734
by: dwainew | last post by:
Problem: I'd like to archive off the contents of a text file. However, other processes may have the file open, so MoveTo(newfilepath) can't be done, as far as I've found. Start with a 5 MB...
9
1393
by: brett | last post by:
I have a main aspx file for my site and use web controls as includes for content. The url may look like this: www.abc.com/main.aspx?page1 I'd like to store content in a text file and...
2
2171
by: apsf68 | last post by:
Hi, Is it possible to have a text file with parameters that msaccess should read on open? Example: when openning my db, it loads a form that will show the invoices to pay in the next 3 days. I...
0
7018
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7182
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,...
1
6906
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
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.