Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiler claims there's an error where there's surely not...

Status
Not open for further replies.

ShikkurDude

Programmer
Mar 15, 2005
55
US
I've declared two objects:
Code:
		Dim ds As New DataSet
		Dim da As New SqlDataAdapter(cmDB)
and passed them into a subroutine:
Code:
	Private Sub FillReqItemsDt(ByRef ds As DataSet, ByVal da As SqlDataAdapter)
		Dim dtRequestedReqItems As New DataTable
		cmDB.CommandText = "RequistionProducts_lst_Requistion"
		cmDB.Parameters.Clear()
		cmDB.Parameters.Add("@RequistionId", readyReq)
		ds.Tables.Add(dtRequestedReqItems)
		da.Fill(dtRequestedReqItems)
	End Sub
I'm getting the strangest error: [tt][SqlException: Line 1: Incorrect syntax near 'RequistionProducts_lst_Requistion'.][/tt]

This code is around line 200, not line 1... The SP seems to work fine in Query Analyzer with the same value for it's parameter...

Any ideas, please???

Thanks!
E.
 
Try adding this line before cmDB.CommandText = "RequistionProducts_lst_Requistion"

Code:
cmDB.CommandType = CommandType.StoredProcedure

Andrea
 
where do you declare cmdDB?

"...we both know I'm training to become a cagefighter...see what happens if you try 'n hit me..."
 
Andrea,

Thank you so much!!! I've done this one bazillion times - but this time I forgot that line and completely couldn't see it!

Thanks!!!
E.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top