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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb 2005&SQL 2005: show results in Query Builder but not in preview of datagridview

Status
Not open for further replies.

kakakaka77

Technical User
Jul 14, 2010
34
0
0
US
Hi, everyone:

I am writing a little window application to show the result from a sql database table.
In Query Builder, the sql query did return the results, but when I run it in the application is not show any record. I also check the preview of the tableadpter, it is not showing either.


FillByStartItemH In Query Builder:
Here is my codes:

SELECT hhhist, hhvend, hdpart, hddesc
FROM vw_hpohd_hpodt
WHERE (hhhist = 'H') AND (hhvend = ?) AND (hdpart LIKE ? + '%')

Enter "1" for hhvend and 9 for hdpart, it DID show me all records stars with 9 for vendorID 1

But when I run this is my application

Me.Vw_hpohd_hpodtTableAdapter.FillByStartItemH(Me.Vista_GSDataSet3.vw_hpohd_hpodt, txtVendor.Text, TextBox1.Text)

I have put "1" in txtVendor textbox and put "9" in textbox1. it is not returning any row in the datagridview.

PS: one thing I have found is the in datagridview preview window (see attachment1), the type is "ansistring", but the type of hhvend and hdpart are string field in the database. Is that the problem? Is there a way I can convert the text in textbox to AnsiString?

Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top