473,383 Members | 1,861 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,383 software developers and data experts.

writing to database

Hi, i'm writing an enquete in C# and i need to write data to a
database.
I'm using stored procedures to do so. Now the problem: I have a
question with a checkboxlist, and the user can select multiple
answers. How do i write all of them to my database?

code: (VoerAntwoordCheckBoxListToe is the name of the stored
procedure)

protected void ButtonVerzenden4_Click(object sender, EventArgs e)
{
AntwoordenCS CheckBoxListAntwoord = new AntwoordenCS();
CheckBoxListAntwoord.VoerAntwoordCheckBoxListToe(

Convert.ToInt32(Request.QueryString["vraag_ID"]),

Convert.ToInt32(CheckBoxListVraag4.SelectedItem.Va lue));
Response.Redirect("Vragenlijst.aspx?vraag_ID=5", true);

stored procedure:

ALTER PROCEDURE [dbo].[VoerAntwoordCheckBoxListToe]

(

@VraagID int,

@KeuzeMogelijkheid int

)

AS

/* SET NOCOUNT ON */

INSERT INTO Antwoorden(antwoord_keuze, vraag_ID)
VALUES(@KeuzeMogelijkheid, @VraagID)

RETURN

With this code a can write the first selected anwser to the database.
Now the trick is to do this for the other selected answers....
thx in advance for your help (and sorry for the crapy english :p)

Apr 5 '07 #1
2 1946
Childtobe wrote:
Hi, i'm writing an enquete in C# and i need to write data to a
database.
I'm using stored procedures to do so. Now the problem: I have a
question with a checkboxlist, and the user can select multiple
answers. How do i write all of them to my database?

[..]
What in the world makes you think that C# or databases are topical
here in comp.lang.c++?
Apr 5 '07 #2
Victor Bazarov wrote:
Childtobe wrote:
>>Hi, i'm writing an enquete in C# and i need to write data to a
database.
I'm using stored procedures to do so. Now the problem: I have a
question with a checkboxlist, and the user can select multiple
answers. How do i write all of them to my database?

[..]


What in the world makes you think that C# or databases are topical
here in comp.lang.c++?
Probably the same thing that made him think they were topical on
comp.lang.c!

--
Ian Collins.
Apr 5 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Google Mike | last post by:
Tell me if this can be done, and if I have a misconception here. I am writing an app that will be served up in an app farm, and therefore I need to move the session information to the client, not...
4
by: George Stout | last post by:
First off I do not know alot about writing queries to an Access Database from an ASP page. This is why I need help. I have an Events database for 6 colleges in our metro area. On the homepage I...
0
by: sedefo | last post by:
I ran into this Microsoft Patterns & Practices Enterprise Library while i was researching how i can write a database independent data access layer. In my company we already use Data Access...
13
by: Jeff Pritchard | last post by:
I have an MDB that contains a single table. Checkweigher data is being continuously written to this MDB from a dedicated workstation over a network into the MDB on the server at the rate of about...
3
by: Marius Rus | last post by:
I have a project in C# that do the followings: From an csv text file it is taking datas and inserted into an paradox database. My problem it is that when writing into the paradox database it is...
12
by: Chris Springer | last post by:
I'd like to get some feedback on the issue of storing data out to disk and where to store it. I've never been in a production environment in programming so you'll have to bear with me... My...
7
by: John Pote | last post by:
Hello, help/advice appreciated. Background: I am writing some web scripts in python to receive small amounts of data from remote sensors and store the data in a file. 50 to 100 bytes every 5 or...
2
by: bazzer | last post by:
can anyone tell me please how i write to an access database from a webform? i can fill listboxes and textboxes and so forth with data from my tables in my database no problem. but i dont have a...
20
by: Vincent Delporte | last post by:
Hello I'm about to write a prototype for a business application, but since this my first real web application, I'm looking for a good book or article that sums up the different issues web...
30
by: Cramer | last post by:
I've finally gotton board with TDD (test driven development) and wow is it effective! I went from sceptic to True Believer with my first effort. My question: According to the various books and...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.