Inserting to DB Question

  • Thread starter Thread starter Patrick Olurotimi Ige
  • Start date Start date
P

Patrick Olurotimi Ige

I have DropDown List ...
that populates some Data..But the DropDown does a postback that
retrieves some other DropDown List with Data
But i want to add Data to the Dropdpwn list they have selected..
The table i want to add to looks like this:-

D_ID|AddID|AdddTypeID|Address
1 |1 |1 |Site 304 NICHOLSON ST FITZROY VIC3065
1 |2 |2 |Delivery 304 NICHOLSON ST FITZROY VIC 3065

I want to the user to Add a new Address with the right D_ID,ADDID and
AddTypeID..

AddID is incremented others won't

Any ideas?
 
Maybe it's me, but I read your question three times and Im still not
entirely sure what you are after. So lets see what I can gest out of your
text.

1.) Running ASP.NET Webform with a DropDownList
2.) DDL is configured to do AutoPostback ?
3.) DDL comes back with different data after the postback ?
4.) You didnt want 3.) to happen, but wanted to add new data ?

Q1.) Did I understand 1-4 correctly above ?
Q2.) Are you using the text property of the DDL to add the new table record
?

Asuming Q1 and Q2 are correct, to add a new row to a table is easy


Dim t As New DataTable
Dim c As New DataColumn("LinkURL")
Dim r As DataRow = t.NewRow()

t.Columns.Add(c)
r(0) = "http://TrainingOn.net"
t.Rows.Add(r)

If I've misunderstood you, please clarify.
 
Terry sorry i was rushing when i wrote the question..
You understood my Question but not everything..
The first thing that appears on the screen is one DropDown List and
after postback 3 other DropDownList appears..
Now the User will be able to selct in the DropDown so now depending on
what they have selected in any of the other 3 DropdownList.I want them
to be able to Add Data to the table the the DropDown list is populated
from..
For example if the DropDwonList they selected is "B" and the value is
"2" when they click (Add) beside the DropDownList i want to retrieve
that value they have selected and add it to the table
Hope that helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top