开发者

passing parameter to Dataenvironment visual basic

开发者 https://www.devze.com 2023-01-31 03:51 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消