What can i do make the SQL statement in bold stretch over more lines of code, so that the whole statement can be seen without scrolling the code window?VB Code:
Private Sub SetSQLStatements() 'Add parameters to use in SQL statements With cmdStaff.Parameters .Add("@EmpID", txtEmpID.Text) .Add("@Surname", txtSurname.Text) .Add("@Forename", txtForename.Text) .Add("@Gender", txtGender.Text) .Add("@DOB", dtpDOB.Text) .Add("@Address", txtAddress.Text) .Add("@Postcode", txtPostcode.Text) .Add("@TelNum", txtTelNum.Text) .Add("@Contract", txtContract.Text) .Add("@Salary", txtSalary.Text) .Add("@Position", txtPosition.Text) .Add("@StartDate", dtpStartDate.Text) .Add("@BookRight", cboBookingRights.Text) .Add("@LoginRight", cboLoginRights.Text) .Add("@MemberRight", cboMemberRights.Text) .Add("@ManageRight", cboManageRights.Text) End With 'Set SQL statements With daStaff .DeleteCommand.CommandText = "DELETE FROM Staff" 'Delete statement .InsertCommand.CommandText = "INSERT INTO Staff" 'Insert statement .[B]UpdateCommand.CommandText = "UPDATE Staff SET Address = @Address, BookingRights = @BookRight, Contract = @Contract, DOB = @DOB, Forename = @Forename, Gender = @Gender, LoginRights = @LoginRight, ManageRights = @ManageRight, MemberRights = @MemberRight, Position = @Position, Postcode = @Postcode, Salary = @Salary, StartDate = @StartDate, Surname = @Surname, [Telephone Number] = @TelNum" 'Update statement[/B] End With End Sub
When i try to do this like i would with an ordinary string i get a syntax error.
p.s. I take a string to a new line by doing.This doesn't appear to work with SQL statements though.VB Code:
Dim bla as String bla = "bla......................................................................." & _ "hello"




Reply With Quote