Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ex: StrSql = "SELECT Name FROM Hospital WHERE PatientsCount ='" & DgvList.Rows(DgvList.RowCount - 1).Cells("DgvPDrID").Valu & "' AND Type='D' "
Posted
Updated 9-Jul-15 20:51pm
v2

The correct way to use values in a SQL statement is to use SqlParameter[^]. For example have a look at http://www.dotnetperls.com/sqlparameter[^]
 
Share this answer
 
Comments
Abhinav S 10-Jul-15 3:11am    
5.
Try DgvList.Rows(yourRowIndex).Cells(yourColumnIndex).Value.
As mentioned, use Sql parameters[^].
 
Share this answer
 
Comments
Wendelius 10-Jul-15 5:09am    
That's it :)
Arjun.nk 11-Jul-15 0:52am    
tnx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900