Apologies if this is a basic question but I am a newbie to VB. I have tried many searches but find it difficult to find a fitting answer.
I am creating a VB 2008 project with SQL 2000 back end.
I have a data source setup, table adapter etc and have populated a form with various fields from the dataset.
I can add records to the DB no problem, however:
What is the correct VB 2008 syntax to populate fields that are not on the form prior to saving the record.
e.g. I have employee ID, First Name, Last Name etc whcih the user enters onto a windows form, but there is a field called hotel ID which the user should not need to populate as this is ascertained from the users login Id.
I have sucessfully created a variable that holds this number @hotelno but don't know how to transfer this value to the SQL field. I wanted something like
hotelno = (Employeesdatas et.Tables(1).Ro ws.Item(0).Item ("hotelid"))
I know my syntax is all to cock, but hopefully you understand what I am trying to do.
I think I am wrong in that I cannot address the dataset as this is a new record I am creating and therefore it doesn't exist in the dataset yet.
Any help will be much appreciated
I am creating a VB 2008 project with SQL 2000 back end.
I have a data source setup, table adapter etc and have populated a form with various fields from the dataset.
I can add records to the DB no problem, however:
What is the correct VB 2008 syntax to populate fields that are not on the form prior to saving the record.
e.g. I have employee ID, First Name, Last Name etc whcih the user enters onto a windows form, but there is a field called hotel ID which the user should not need to populate as this is ascertained from the users login Id.
I have sucessfully created a variable that holds this number @hotelno but don't know how to transfer this value to the SQL field. I wanted something like
hotelno = (Employeesdatas et.Tables(1).Ro ws.Item(0).Item ("hotelid"))
I know my syntax is all to cock, but hopefully you understand what I am trying to do.
I think I am wrong in that I cannot address the dataset as this is a new record I am creating and therefore it doesn't exist in the dataset yet.
Any help will be much appreciated
Comment