
May 21st, 2005, 01:40 PM
|
|
Contributing User
|
|
Join Date: Feb 2004
Posts: 447

Time spent in forums: 2 Days 6 h 1 m 30 sec
Reputation Power: 5
|
|
Updating Records in Multiple Tables
I already know how to upate records in multiple tables via recordsets. I would like to know how to update records in multiple tables using a stored procedure. I am not exactly sure how you could do this.
Here's my code:
strSql = "Update DomainName Set DomainName=@DomainName, Registrar=@Registrar,ExpirationDate=@ExpirationDat e, BusinessName=@BusinessName, ClientID=@ClientID From DomainName D Join Clients C On D.ClientID=C.ClientID Where DomainNameID=@DomainNameID"
cmdSql = New SqlCommand( strSql, conDomainName )
cmdSql.Parameters.Add( "@DomainName", strDomainName )
cmdSql.Parameters.Add( "@Registrar", strRegistrar )
cmdSql.Parameters.Add( "@ExpirationDate", ExpirationDate)
cmdSql.Parameters.Add( "@BusinessName", BusinessName)
cmdSql.Parameters.Add( "@ClientID", intClientID)
cmdSql.Parameters.Add( "@DomainNameID", intDomainNameID )
BusinessName is from the Clients Table. The other fields are from the DomainName Table.
|