How to update/delete mapping table records in SQL server 2005 - Help needed

asp.net 2.0 , vb.net , sql server 2005 , visual studio 2005 , linking table Wellington, New Zealand
  • 11 years ago
    Hi, I am using these: ASP.Net 2.0, VB.Net, SQL Server 2005, Visual Studio 2005, Typed dataset & data table adapters using xsd file and BLL classes. Example scenario (copied from somebody who asked the same question and not answered with examples.) Table 1 Main ID (autonumber) field1 field2 field3 Table 2 MainID HabitatID Table 3 Habitat ID (autonumber) field4 field5 field6 What I want to to do in my form: User enters records in table 1. Auto number is assigned, say '5'. User enters records in table 3. How do I ensure the records the user has entered in table 1 and 2 are linked? How can I make the MainID in table 2 the same the MainID in table 1? What should look like after user has entered all there records Table 1 Main ID (autonumber) =5 field1 field2 field3 Table 2 MainID =5 HabitatID =19 Table 3 Habitat ID (autonumber) = 19 field4 field5 field6 How can I do this? Help! In the SQL server database, I have enabled the cascading delete and update options both sides of relationship for the Table 2. But I don't know how to ensure the update/delete these table records through SQL statements (Store procedure) from a ASP.Net form. FYI: I am using Typed datasets & data table adapters using xsd file and BLL classes. Could somebody point any working examples in the internet? Thanks

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves” - Alan Kay