[RESOLVED] Database value save

<div style="margin-top: 10.08pt; margin-bottom: 0pt; margin-left: 0.38in; text-indent: -0.38in; text-align: left; direction: ltr; unicode-bidi: embed; vertical-align: baseline;">enrolls (sid, coursecodesemester, year)</div><div style="margin-top: 10.08pt; margin-bottom: 0pt; margin-left: 0.38in; text-indent: -0.38in; text-align: left; direction: ltr; unicode-bidi: embed; vertical-align: baseline;">suppose Student enroll 5 or 6 courses(coursecode) of semester 1. how i can save in my table like this
</div>

sid

Course code

Semester

Year

b1

Csc100

1

2010

b1

Csc101

1

2010

b1

Csc102

1

2010

b1

Csc103

1

2010

b1

Csc104

1

2010

1)sid=sessionid

2)Dropdownlist select semester ==>> selected semester courses in a listbox

3)Year select


insert into enroll(sid,Semester,coursecode,year) values (@sid,@semester,@coursecode,@year) .

<div style="margin-top: 10.08pt; margin-bottom: 0pt; margin-left: 0.38in; text-indent: -0.38in; text-align: left; direction: ltr; unicode-bidi: embed; vertical-align: baseline;">
</div><div style="margin-top: 10.08pt; margin-bottom: 0pt; margin-left: 0.38in; text-indent: -0.38in; text-align: left; direction: ltr; unicode-bidi: embed; vertical-align: baseline;">
</div><div style="margin-top: 10.08pt; margin-bottom: 0pt; margin-left: 0.38in; text-indent: -0.38in; text-align: left; direction: ltr; unicode-bidi: embed; vertical-align: baseline;">
</div>

Hi,

This table is not enough.It is Bad Design.see how you will design tabes for it.

This gif is from 

Entity-Relationship (ER) Diagrams



Next You can Create View and Insert in that view otherwise you can use

Insert statement for Multiple tables.


Regards


I have to save Listbox  values in to my table (listbox multiply values i.e 6 vales)

listbox=coursecode


foreach (ListItem listitem in ListBox1.Items)

selected vales save table



Hi,

Ok if you don't bother about database design It is big prob from tomm.Anyways just see how you can write sql query to insert multiple records in table


Tutorial 3 - Adding Multiple Records to a Child Table Using Stored ...

[Solved] How to Insert multiple values from a listbox or ...

DotNet Asp: Inserting multiple values from a listbox into a ...


You can See this thread where someone has already resolved this issue

Insert Multiple Selected Items of a List box into table - ASP.NET ...

Regards

shabir

thoughts on "[RESOLVED] Database value save"

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>