Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > writing to database

Reply
Thread Tools

writing to database

 
 
Childtobe
Guest
Posts: n/a
 
      04-05-2007
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 )

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      04-05-2007
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++?


 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      04-05-2007
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Any problems with writing the information into a file - Multi-users perform writing the same file at the same time ???? HNguyen ASP .Net 4 12-21-2004 01:53 PM
writing quotes to database Netfreaky ASP .Net 3 05-18-2004 07:27 PM
Writing to database before HTTP POST Erik ASP .Net 2 12-13-2003 05:42 AM



Advertisments