many to many tables linked to grid view
Posted
by
yousof
on Stack Overflow
See other posts from Stack Overflow
or by yousof
Published on 2011-01-09T07:49:16Z
Indexed on
2011/01/09
7:53 UTC
Read the original article
Hit count: 277
i have web page that save data for stores, these stores have activities i want to determine the activities for those stores. this reason i make three tables: first one is :
tbOLActivity has fields: ActivityId int (pk), ActivityName nvarchar(50)
second one is :
tbOLStore has fields: StoreId int (pk), StoreName nvarchar(50), ActivityId int (fk), Address navrchar(50)
therd one is:
tbOLStoreActivty has fields : SerialNo int (pk), StoreId int (fk), ActivityId int (fk), Activity_Status int
i make combobox in web page called "AcivityCombo" to display the data of tbOLActivity table
If CtvAct.GetRecords("Fill_ActivityTb") = True Then
AcivityCombo.DataSource = CtvAct.MainDataset.Tables("tbOLActivity").DefaultView
AcivityCombo.DataTextField = "ActivityName"
AcivityCombo.DataValueField = "ActivityId"
AcivityCombo.DataBind()
the problem is how to select item from this combo and insert it into gridview then save data into the tables
© Stack Overflow or respective owner