writing function in vb.net
-
Hi, i want help in writing a savefunction in vb.net. requirement is: An array of hat objects is passed into the function. The hat in each object is then saved to the database table.The following properties are set in each hat object :objectID,date,quantity. Table used is hat1 Parameter passed into the function is arrayhat which is an array of hat objects. using .net2.0/vb.net/oracle. Thanks
-
Hi, i want help in writing a savefunction in vb.net. requirement is: An array of hat objects is passed into the function. The hat in each object is then saved to the database table.The following properties are set in each hat object :objectID,date,quantity. Table used is hat1 Parameter passed into the function is arrayhat which is an array of hat objects. using .net2.0/vb.net/oracle. Thanks
So what's the question? You iterate over the collection of hat objects passed in, get the ID from the object, and check to see if it's in the database. If not, INSERT a new record in the database using the data supplied for that record. If it does exist, UPDATE the existing record. Better yet, this would probably be better suited as a stored procedure in the database. All you would have to do is pass in the 3 parameters to the procedure and it should do the appropriate checks and updates.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
So what's the question? You iterate over the collection of hat objects passed in, get the ID from the object, and check to see if it's in the database. If not, INSERT a new record in the database using the data supplied for that record. If it does exist, UPDATE the existing record. Better yet, this would probably be better suited as a stored procedure in the database. All you would have to do is pass in the 3 parameters to the procedure and it should do the appropriate checks and updates.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007thanks Dave