Click here to Skip to main content
15,878,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi am new to , I have one doubt in How to compare the textbox value with the database field and to retrieve the matched rows in gridview . please any one give an idea.
thatraja 28-Dec-11 0:30am    
Where is your code?


Write a stored procedure or query which accepts some text(in your case it is textbox text) and pull the data using query like following

select (your fileds) from yourtable where (yourdatabase field to be compared) like '%'+your textbox value+'%'

Hope this helps
Share this answer
Write a sp and send text box value in one parameter using sql command object.
Query will be
select * from TableName where TableField = @TextBoxValue

Now, using run cmd.ExecuteNonQuery() and using dataadapter fill data to dataset. and bind this dataset to gridview.
Share this answer
Try This Store procedure for comparing txt from txtbox and value from DB.
first give the value to storeprocedure it will compaire from db value

@supname char(7)
supid_name as [Supplier Name]
From Supplier
Share this answer

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