how to check existence of value in database to be inserted in text box before insertion in asp.net c# windows form application?
windows form application
Collapse
X
-
Tags: None
-
I think I could speak for others that you need to rephrase your question so it not only was readable thus easier to help you your quandary. -
Check out this article on how to use a database in your program.
It explains how to connect to a database, retrieve data from it (check data), and save data to the database.
-FrinnyComment
-
If you want to check if the value of the textbox is not empty, just use and if statement like:
Code:if(textbox1.text != "")
Comment
-
if you want to check if the value in the textbox in null or not before adding into the database, you can you use a RequiredFieldVa lidator or you can simply use a javascript funtion like this
Code:<script type="text/javascript"> function Validation() { var vName = document.getElementById("<% =txtName.ClientID %>").value; if (vName == "") { alert("Please Enter your Current password") return false; } return true; } </Script>
Comment
-
I am going to delete this question in a couple of days if the original poster (kirtisapra) doesn't reply because the question is too vague and doesn't make sense; hence making it impossible to answer.
You can't combine windows form applications with ASP.NET applications first of all.
Secondly, I'm not sure how the database is being used.
Thirdly, I'm not sure if the problem is with actually inserting the value into the database or if the problem is with validating the data before inserting it into the database.
Maybe the question is about how to have an ASP.NET application and a Windows Forms application use the same database. Which would explain the reference to the windows forms application and the reference to the ASP.NET application.
But, like I said, this question is impossible to answer because it is too vague and needs more explanation from the original poster if they really want help.
-FrinnyComment
Comment