private void CheckContactNumber() { string checkContactNum = "SELECT COUNT(*) FROM Employee WHERE ContactNumber = " + addContactNum.Text + " "; //01234567890 OleDbCommand cmd = new OleDbCommand(checkContactNum, conn); conn.Open(); OleDbDataReader dr = cmd.ExecuteReader(); //if (dr.Read() && addContactNum.Text != "") if (dr.Read()) { int count = (int)dr[0]; if(count>0) { err += "Contact number is already listed in the database\r\n"; errorContactNum.Visible = true; uniqueContactNumber = false; } } conn.Close(); }
Shraddha_Patel
Posts
-
how to check if value exists in database from textbox c# -
I need to add “Add new item” option in Select2I need to add “Add new item” option in Select2
-
Finalize() vs Dispose()This is difference between Finalize() VS Dispose():- - Methods dispose() and finalize() are the methods of C# which are invoked to free the unmanaged resources held by an object. - The dispose() method is defined inside the interface IDisposable whereas, - the method finalize() is defined inside the class object. - The main difference between dispose() and finalize() is that the method dispose() has to be explicitly invoked by the user whereas, the method finalize() is invoked by the garbage collector, just before the object is destroyed
-
javascriptYou can use this code....
Name
Type
Action
Display var myArray = \[{ "name": "aaa", "level": "A" }, { "name": "bbb", "level": "B" }, { "name": "ccc", "level": "C" }\]; function display() { var length = myArray.length; var htmltext = ""; for (var i = 0; i < length; i++) { console.log(myArray\[i\]); htmltext += "<tr id='table"+i+"'><td>" +myArray\[i\].name+ "</td><td>" +myArray\[i\].level+ "</td><td><button onclick='edit("+i+")'>Edit</button><button onclick='remove("+i+")'>Remove</button></td></tr>"; } document.getElementById("tbody").innerHTML = htmltext; } function edit(indice) { var htmltext = "<tr><td><input id='inputname"+indice+"' type='text' value='" +myArray\[indice\].name+ "'></td><td><input id='inputlevel"+indice+"' type='text' value='" +myArray\[indice\].level+ "'></td><td><button onclick='save("+indice+")'>Save</button><button onclick='remove("+indice+")'>Remove</button></td></tr>"; document.getElementById("table"+indice).innerHTML = htmltext; } function save(indice) { myArray\[indice\].name = document.getElementById("inputname"+indice).value; myArray\[indice\].level = document.getElementById("inputlevel"+indice).value; var htmltext = "<tr id='table"+indice+"'><td>" +myArray\[indice\].name+ "</td><td>" +myArray\[indice\].level+ "</td><td><button onclick='edit(" +indice+")'>Edit</button><button onclick='remove(" +indice+")'>Remove</button></td></tr>"; document.getElementById("table"+indice).innerHTML = htmltext; } function remove(indice) { console.log(myArray); myArray.splice(indice, 1); display(); }
-
How to call function second time?You can call this function on restart button onClick event... function restartquiz(){ $(document).on('click', function() { showQuestions(); }); }
-
What is J Query in JavascriptjQuery is a lightweight, "write less, do more", JavaScript library. The purpose of jQuery is to make it much easier to use JavaScript on your website. jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code. jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.
-
jquery validation in drop downjquery validation in Drop down.. if i am select the value another same div can't select this value.. and print the alerdy message "this value already selected"
-
How To Fix SQL Database Error 824 ?SQL server database 824 error means that the page has been read successfully from the disk but there is some issue with the page. Other types of messages that might be shown are “fatal error 824 occurred” , “SQL server detected logical consistency based i/o error”. The exact display message can be more helpful in understanding this problem.
-
Product Architecture1. Data Product Architectures Benjamin Bengfort @bbengfort District Data Labs 2. Abstract 3. What is data science? Or what is the goal of data science? Or why do they pay us so much? 4. Two Objectives Orient Data Science to Users 5. Data Products are self-adapting, broadly applicable software-based engines that derive their value from data and generate more data by influencing human behavior or by making inferences or predictions upon new data. 6. Data Products are Applications that Employ Many Machine Learning Models 7. Data Report 8. Without Feedback Models are Disconnected They cannot adapt, tune, or react. 9. Data Products aren’t single models So how do we architect data products? 10. The Lambda Architecture 11. Three Case Studies 12. Analyst Architecture 13. Analyst Architecture: Document Review 14. Analyst Architecture: Triggers 15. Recommender Architecture 16. Recommender: Annotation Service 17. Partisan Discourse Architecture 18. Partisan Discourse: Adding Documents 19. Partisan Discourse: Documents 20. Partisan Discourse: User Specific Models 21. Commonalities? 22. Microservices Architecture: Smart Endpoints, Dumb Pipe HTTP HTTP HTTP HTTP HTTPHTTP HTTP Stateful Services Database Backed Services 23. Django Application Model 24. Class Based, Definitional Programming from rest_framework import viewsets class InstanceViewSet(viewsets.ModelViewSet): queryset = Instance.objects.all() serializer_class = InstanceSerializer def list(self, request): pass def create(self, request): pass def retrieve(self, request, pk=None): pass def update(self, request, pk=None): pass def destroy(self, request, pk=None): pass from django.db import models from rest_framework import serializers as rf class InstanceSerializer(rf.ModelSerializer): prediction = rf.CharField(read_only=True) class Meta: model = Instance fields = ('color', 'shape', 'amount') class Instance(models.Model): SHAPES = ('square', 'triangle', 'circle') color = models.CharField(default='red') shape = models.CharField(choices=SHAPES) amount = models.IntegerField() 25. Features and Instances as Star Schema 26. REST API Feature Interaction 27. Model (ML) Build Process: Export Instance Table COPY ( SELECT instances.* FROM instances JOIN feature on feature.id = instance.id ... ORDER BY instance.created LIMIT 10000 ) as instances TO '/tmp/instances.csv' DELIMITER ',' CSV HEADER; 28. Model (ML) Build Process: Build Model import pandas as pd from sklearn.svm import SVC from sklearn.cross_validation import KFold # Load Data data = pd.read_csv('/tm
-
What is an image map?What is an image map?
-
Explain the working of timers in JavaScript? Also elucidate the drawbacks of using the timer, if any?Explain the working of timers in JavaScript? Also elucidate the drawbacks of using the timer, if any?
-
What is an alias?What is an alias?
-
How can you get the alternate records from the table in the SQL?How can you get the alternate records from the table in the SQL?
-
how to add image