I am writing a simple database program and using a sdf file created with vb 2010 pro
the following code is supposed to write to the database but I can't get it to any suggestions?
Code:
Dim New_Customer As KCASDataSet.CustomersRow ' sets the veriable to all the colloms of the table
Dim New_Cust_Id As String
Number_of_Records = KCASDataSet.Tables("Customers").Rows.Count 'gets the number of rows in the table
New_Cust_Id = ("0000000") & Number_of_Records 'sets the cust ID with 7 0 before it
Dim New_Cust_Id_Second As String = Microsoft.VisualBasic.Right(7, New_Cust_Id) ' gets the last 7 digits of the cust Id
New_Customer = KCASDataSet.Customers.NewCustomersRow() 'is supposed to make it so the veriable will get all data for the row
New_Customer.Customer_Number = New_Cust_Id_Second
New_Customer.First_Name = txtb_New_Customer_First_Name.Text
New_Customer.Last_Name = txtb_New_Customer_Last_Name.Text
New_Customer.Phone_Number = txtb_New_Customer_Phone_Number.Text
New_Customer.Cell_Phone_Number = txtb_New_Customer_Cell.Text
New_Customer.Street_Number = txtb_New_Customer_Street_Number.Text
New_Customer.Street = txtb_New_Customer_Street.Text
New_Customer.Town = txtb_New_Customer_Town.Text
New_Customer.State = txtb_New_Customer_State.Text
New_Customer.Zip = txtb_New_Customer_Zip.Text
KCASDataSet.Customers.Rows.Add(New_Customer) 'supposed to add the row to the table
MsgBox("New Customer added", 0)
Me.Close()
the following code is supposed to write to the database but I can't get it to any suggestions?
Code:
Dim New_Customer As KCASDataSet.CustomersRow ' sets the veriable to all the colloms of the table
Dim New_Cust_Id As String
Number_of_Records = KCASDataSet.Tables("Customers").Rows.Count 'gets the number of rows in the table
New_Cust_Id = ("0000000") & Number_of_Records 'sets the cust ID with 7 0 before it
Dim New_Cust_Id_Second As String = Microsoft.VisualBasic.Right(7, New_Cust_Id) ' gets the last 7 digits of the cust Id
New_Customer = KCASDataSet.Customers.NewCustomersRow() 'is supposed to make it so the veriable will get all data for the row
New_Customer.Customer_Number = New_Cust_Id_Second
New_Customer.First_Name = txtb_New_Customer_First_Name.Text
New_Customer.Last_Name = txtb_New_Customer_Last_Name.Text
New_Customer.Phone_Number = txtb_New_Customer_Phone_Number.Text
New_Customer.Cell_Phone_Number = txtb_New_Customer_Cell.Text
New_Customer.Street_Number = txtb_New_Customer_Street_Number.Text
New_Customer.Street = txtb_New_Customer_Street.Text
New_Customer.Town = txtb_New_Customer_Town.Text
New_Customer.State = txtb_New_Customer_State.Text
New_Customer.Zip = txtb_New_Customer_Zip.Text
KCASDataSet.Customers.Rows.Add(New_Customer) 'supposed to add the row to the table
MsgBox("New Customer added", 0)
Me.Close()