passing parameter to Dataenvironment visual basic
HI,
I am working on Visual Basic DataEnvironment I have written SQL command but i need to pass some parameter from one of my form object. I have tried this
SELECT *开发者_开发问答 from user WHERE userid= form1.textbox1.text
but it doesn't seems to be work. Any Idea how to pass parameter.
I would suggest performing a filter on the recordset inside your DataEnviroment instead placing the WHERE clause where your SQL statement is defined.
With DataEnvironment1.rsDataTable
.Filter = "UserID = " & textbox1.text
End With
Please check out the following links. I hope this helps. http://msdn.microsoft.com/en-us/library/aa231245(v=vs.60).aspx http://pages.cpsc.ucalgary.ca/~saul/vb_examples/tutorial4/index.html
Also, if possible I would recommend using ADO instead of the DataEnvironment.
精彩评论