Click here to Skip to main content
15,892,839 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: reg Super script and subscript Pin
EliottA23-Mar-10 2:54
EliottA23-Mar-10 2:54 
AnswerRe: reg Super script and subscript Pin
The Man from U.N.C.L.E.22-Mar-10 8:16
The Man from U.N.C.L.E.22-Mar-10 8:16 
QuestionProblem sub-total Matrix with rdlc report in vb.NET [modified] Pin
rhap122-Mar-10 6:02
rhap122-Mar-10 6:02 
QuestionBold From FontDialog Pin
Anubhava Dimri21-Mar-10 21:44
Anubhava Dimri21-Mar-10 21:44 
AnswerRe: Bold From FontDialog Pin
The Man from U.N.C.L.E.22-Mar-10 2:31
The Man from U.N.C.L.E.22-Mar-10 2:31 
GeneralRe: Bold From FontDialog Pin
Anubhava Dimri22-Mar-10 23:08
Anubhava Dimri22-Mar-10 23:08 
GeneralRe: Bold From FontDialog Pin
Dave Kreskowiak23-Mar-10 1:11
mveDave Kreskowiak23-Mar-10 1:11 
QuestionIncorrect syntax Pin
fresh120721-Mar-10 10:54
fresh120721-Mar-10 10:54 
I am trying to insert data into SQL Server 2008 table using vb.net. When I try to insert the data I get the error "OleDbException was unhandled" Incorrect syntax near 'Name'. The code line MyCommand.ExecuteNonQuery is highlighted when the error is thrown. I can't find anything wrong. Can someone please help me out? Here is my code:

Dim myConnection As New OleDb.OleDbConnection<br />
        myConnection.ConnectionString = "Provider=SQLNCLI10;Server=S10615-10\SQLEXPRESS;Database=Assessment; Trusted_Connection=yes;"<br />
<br />
        Dim myCommand As OleDb.OleDbCommand<br />
        Dim strOleDb As String<br />
<br />
        myConnection.Open()<br />
<br />
        strOleDb = "INSERT INTO AssessmentPage1 (Client Name, DOB, Medical Records #, Medicaid Number, Consumer's Name, Medicaid #, Consumer's ID, Clinicians, Parents/Guardians Name, Address, Clinicians(1), Phone Numbers, Date or Referral, Date of Assessment, School Name/Address/Phone #, Identifying Information, Presenting Problems, Referral Information) VALUES(" & TextBox1.Text & "," & TextBox2.Text & "," & TextBox3.Text & "," & TextBox4.Text & "," & TextBox5.Text & "," & TextBox6.Text & "," & TextBox7.Text & "," & TextBox8.Text & "," & TextBox9.Text & "," & TextBox10.Text & "," & TextBox11.Text & "," & TextBox12.Text & "," & TextBox13.Text & "," & TextBox14.Text & "," & TextBox15.Text & "," & TextBox16.Text & "," & TextBox17.Text & "," & TextBox18.Text & ")"<br />
<br />
<br />
        myCommand = New OleDb.OleDbCommand(strOleDb, myConnection)<br />
        myCommand.ExecuteNonQuery()<br />
<br />
        'Close and clean up objects<br />
        myConnection.Close()<br />
        myCommand.Dispose()<br />
        myConnection.Dispose()

AnswerRe: Incorrect syntax Pin
Luc Pattyn21-Mar-10 11:22
sitebuilderLuc Pattyn21-Mar-10 11:22 
AnswerRe: Incorrect syntax Pin
DaveAuld21-Mar-10 11:37
professionalDaveAuld21-Mar-10 11:37 
GeneralRe: Incorrect syntax Pin
fresh120721-Mar-10 18:06
fresh120721-Mar-10 18:06 
GeneralRe: Incorrect syntax Pin
εїзεїзεїз21-Mar-10 19:38
εїзεїзεїз21-Mar-10 19:38 
GeneralRe: Incorrect syntax Pin
Steven J Jowett22-Mar-10 3:03
Steven J Jowett22-Mar-10 3:03 
GeneralRe: Incorrect syntax Pin
fresh120722-Mar-10 7:43
fresh120722-Mar-10 7:43 
GeneralRe: Incorrect syntax Pin
David Skelly22-Mar-10 23:15
David Skelly22-Mar-10 23:15 
QuestionScreen sizes Pin
offroaderdan21-Mar-10 2:58
offroaderdan21-Mar-10 2:58 
AnswerRe: Screen sizes Pin
DaveAuld21-Mar-10 3:27
professionalDaveAuld21-Mar-10 3:27 
GeneralRe: Screen sizes Pin
offroaderdan21-Mar-10 7:56
offroaderdan21-Mar-10 7:56 
GeneralRe: Screen sizes Pin
Dalek Dave21-Mar-10 8:05
professionalDalek Dave21-Mar-10 8:05 
GeneralRe: Screen sizes Pin
Dalek Dave21-Mar-10 13:50
professionalDalek Dave21-Mar-10 13:50 
GeneralRe: Screen sizes Pin
David Skelly21-Mar-10 23:05
David Skelly21-Mar-10 23:05 
GeneralRe: Screen sizes Pin
Dalek Dave21-Mar-10 23:10
professionalDalek Dave21-Mar-10 23:10 
GeneralRe: Screen sizes Pin
DaveAuld21-Mar-10 9:20
professionalDaveAuld21-Mar-10 9:20 
GeneralRe: Screen sizes Pin
offroaderdan21-Mar-10 10:01
offroaderdan21-Mar-10 10:01 
GeneralRe: Screen sizes Pin
DaveAuld21-Mar-10 10:24
professionalDaveAuld21-Mar-10 10:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.