windows form application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kirtisapra
    New Member
    • Jul 2012
    • 1

    windows form application

    how to check existence of value in database to be inserted in text box before insertion in asp.net c# windows form application?
  • PsychoCoder
    Recognized Expert Contributor
    • Jul 2010
    • 465

    #2
    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.

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      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.

      -Frinny

      Comment

      • michaeldebruin
        New Member
        • Feb 2011
        • 134

        #4
        If you want to check if the value of the textbox is not empty, just use and if statement like:

        Code:
        if(textbox1.text != "")
        Otherwise if you want to check if the inserted value in the textbox already exists in the database. Just use an if statement to check if the value in the textbox matches any data in database.

        Comment

        • Mudassir
          New Member
          • May 2012
          • 85

          #5
          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

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            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.

            -Frinny

            Comment

            Working...