You are browsing MYSQL Forum.
|SEARCH YOUR SOLUTION HERE
i keep on getting this error message incorrect syntax in line1... funny thing is when i run eso thing from SQL Query Analyzer it works just fine but when i am executing the stored procedure from .net i keep on getting the errro message which i have mentioned above..
my sql stored procedure code snippet is as follows:
Create PROCEDURE databaseo.OracleStudentTbl
@tblName as varchar(255)
DECLARE @SQL as varchar(8000)
DECLARE @tbl as varchar(255)
SET @tbl =@tblName
'INSERT INTO [databaseo].['+@tbl+']'
SELECT * FROM OPENQUERY(XXXX 'SELECT * FROM vw_student_details_forsurvey')
basically what my stored procedure is doing is fetching a table name from my vb.net windows form then passing it to the stored procedure, then my SELECT * FROM OPENQUERY is populating the the table with its info... but as i mentioned i get the syntax error message...my code snippet in my command button on vb.net is as follows:
Private Sub butSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butSave.Click
Dim varDetails As String = txtDetails.Text + "_" + txtDetailsTblName.Text
Dim sqlCommandDetailsInsert As New SqlCommand("OracleStudentTbl", connStr)
sqlCommandDetailsInsert.CommandType = CommandType.StoredProcedure
'this command is sending to the stored procedure the table name for the Students Details Table so that
'student details table will be populated with the data from the Oracle View
sqlCommandDetailsInsert.ExecuteNonQuery() ' get error message here when i am deberroring my windows forms
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "ErrorIn Code")
Dim frmMain As New frmMain
frmMain.mySQLname = var
would applicationlaud assist pls..
Posted On: Monday, November 12, 2012
Total Views: 31
View Complete with Replies
This webpage contains content related to MYSQL. If question related to " error message incorrect syntax" is not helpful or you didn't find the question or answer you were looking for then you can ask a new question through contact form. Our development Team will be happy to help you. This article was posted on Monday, November 12, 2012 and having 31 views till Saturday, October 25, 2014.