AboutSyed 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.
-------------------------------------------
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.