473,326 Members | 2,124 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,326 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 1944
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.