Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everybody,
I am new to .NET. I created a table in SQL which has to columns. I want to search in this table. I will input values into the textboxes and if these values don't exist in the table I want to update ([Editor]insert??) the columns with the textbox values.

Pleas help me!

Thank you.


[Edited: grammar, spelling, tag: Sql, title]
Posted
Updated 2-Jan-11 23:20pm
v2
Comments
Sunasara Imdadhusen 3-Jan-11 5:00am    
Did you tried anything for that?
Sandeep Mewara 3-Jan-11 5:02am    
Kind of trying to update with unique value? Is it?
Hiren solanki 3-Jan-11 5:29am    
Learn basics first you will automatically get your answer. That isn't a hard thing.there's lots of article around for learning basic things, search google.

1 solution

Hi,

Using Stored Procedure in Sql Server you can do it.
Just pass your parameter into query if record is exists update the record based on Primary Key(Id value) else insert the record into database.

For your reference....

http://www.dotnetspider.com/forum/48300-How-insert-update-delete-data-into-SQL-server-with-using-SPs-Urgent.aspx[^]

Just refer this link and try it yourself then only you can learn something because you said I am new to .NET.


Cheers :)
 
Share this answer
 
Comments
Sandeep Mewara 3-Jan-11 5:34am    
I doubt that was the question. Sounded like it was around uniqueness check.

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