Click here to Skip to main content
16,022,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to check the inserted values in Text Box is available in database Table or not.the code is in vb.net and Sql server database.
plz help me someone
Posted
Comments
OriginalGriff 8-Jul-12 10:39am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
[no name] 8-Jul-12 10:39am    
"i want to check".. okay so go right ahead that do that.

Try:
1. Use ADO.NET to talk to database and retrieve the information
2. Use query to find out the existence. One such example:
SQL
-- See if any row returned?
SELECT * FROM MyTable WHERE ValueToCheck = @SeeIfThisValueExists


These would help:
MSDN: ADO.NET[^]
MSDN: Accessing Data with ADO.NET[^]

Learn and try. If you get stuck, ask specific issue.
 
Share this answer
 
v2
If you are using commands, you can actually check for the return value from the command.
E.g.
//id will contain the inserted value.
int id = Convert.ToInt32(cmd.ExecuteScalar() );
 
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