i have textbox for my user to type first 3 or 4 or any number of characters to seach for full name of drug from sql table named grugs
i used Lenght function to find no of characters typed so i can use this number with substring function to display all drug names started with enterd characthers
int i = textBox1.Text.Lenght;
select * from drugs where Substring(drg_name,0, i ) = textBox1.Text
but this gives me Error says Invalid Column name i
any Idea smart pepole ?


Amit GuptaRank #190 · 12.8K reputationPosted May 1, 2021, 12:41 AM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted May 1, 2021, 2:08 AM EDT