I need to insert more than one record into a SQL database at the same time.
I want to be able to create a list out of two sources on the page.
The first is Name, which is loaded from an SQL table into a Datagrid at PageLoad.
The second is Nickname which is entered in a Textbox. When a name is selected and a nick is entered I guess I need to load those values into a couple of arrays, as itīs all going into the database (Well, NameID and Nickname is going into the Nickname table).
I need to know how to create this list of up to 15 nicks and display them on the page. Does anyone have any ideas??
Thanks
You can do this using stored procedures if you are working in a SQL server box.
Below is a snippet from a stored sql database procedure that I have created to insert new picture names into a database. Just replace your variables with the variables you need. You may need to do some reading on stored procedures to get this to work with your page, because you will need to know how to call and pass your variables to the stored procedure.
Code:
CREATE PROCEDURE DatabaseName.DInsertProductPics
(
@ProductID numeric,
@PicID numeric,
@PicName nvarchar(150) = null
)
AS
SET NOCOUNT ON
Insert into DataTableName(ProductID, PicID, PicName) Values(@ProductID, @PicID, @PicName)
Insert into DateTableName2(ProductID, PicID, PicName) Values(@ProductID, @PicID, @PicName)
RETURN
Hope this helps...
__________________
Best Regards,
Brian Thuen
http://www.AdvisedSolutions.com