Member Avatar for JUNG_1

Hi! My name is Jung and I'm new to VBNET

I have already tried many ways to write codes for "btnSearch" but seems like nothing works..
I really need help for this as the deadline is around the corner :'(

Below are my codes for Search button..

btnsearch.PNG

Try

cmbSearch.CommandText = "SELECT Assignment FROM Apu WHERE StudentID = '" & txtStudentID.Text & "';"

The format is

SELECT <fields> FROM <table> WHERE <conditions>

I strongly suggest, however, that instead of building queries by concatenation you use parameterized queries.

Member Avatar for JUNG_1

Tried it but still error but it's ok I know where I did wrong :) THANK YOU!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.