AllExperts > Experts 
Search      

VB.NET

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More VB.NET Answers
Question Library

Ask a question about VB.NET
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Syed Rizwan Muhammad Rizvi
Expertise
I can answers questions regarding web based and desktop based programming in VB.Net. Which can include SOAP, XML, Custom Controls, COM Interoperability etc.

Experience
Have been working in this specific area for last 2 years previously I was a VB 6 Developer with experties in other languages as well. Total 10 years of programming experience.

 
   

You are here:  Experts > Computing/Technology > Basic > VB.NET > query

Topic: VB.NET



Expert: Syed Rizwan Muhammad Rizvi
Date: 10/26/2006
Subject: query

Question

-------------------------------------------
The text above is a follow-up to ...

-----Question-----
-------------------------------------------
The text above is a follow-up to ...

-----Question-----
hi,syed.my name is piyush.thanx 4 u'r answer but can u tell me the wayto do the second step(making the field as identity coloumn and not let the user enter the pk value. plz its urgent.
-----Answer-----
when the save button is clicked you need to check if the PK already exists in the database or not and act accordingly, another way is to make the field as identity column and not let the user enter the PK value.
-----Answer-----
in sql server select the PK, and modify field's isIdentity or Identity property to true/yes.


hi syed, thanx for all u'r replies.but i have one more follow-up question and bet that after that i will not ask any more question in this regard.

     actually accoring to my HOD it has to show the msgbox written please enter any other roll no. or should written u can make entry as roll no.2 its absolutely right that writin PK value in SQL server would make it easy but it will not do exactly the same actually i make the field as primay key but it should show the msg in my query as i enter the same roll no. at the execution.which is not to be there.it should be linked with vb.net pgmming by which on entering the same value it shows the msgbox.

what more i can add in vb.net programming below to solve the purpoes-

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
msgbox("enter any other id");

what more i can add.

plz reply me soon.thanx.


Answer
Dont put it on TextChanged Event, rather put on save's click or text box's lostfocus event. Make a query to database with try to retrieve a record with the Roll Number entered in the field, and if a row returns it means that the rollnumber is a duplicate if no rows return then it means that the rollnumber is OK to go. That should help, if it don't ask me for further clarifications.

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.