Normally, I insert data like this for my web pages (VB.NET):
cmd = New SqlCommand("Add_NewOrder", Conn)
cmd.CommandType = CommandType.StoredProcedure
Dim NewCateringOrderID As SqlParameter
NewCateringOrderID = New SqlParameter("@NewCateringOrderID", SqlDbType.BigInt)
NewCateringOrderID.Direction = ParameterDirection.Output
' pass customer info to stored proc
I am taking a test for a job, and I am guessing they don't want m e to do it this way. Is there a way to shove an insert into a class as a method then somehow use it to do the insert? How would I pass parameters or create the right parameters though...meaning if I called the method by creating an instance of the class, how would it know which parameters to create if you wanted to reuse the method?
and what about an update method?