How to validate if the item you want to add in the cart is already exists in listView items? for example I already add CH001 which is the productId of Chocolate strawberry, then I accidentally add again that product Id and I what I want is that it should not be accepted on my listview again because CH001 is already on my cart.
I have this table Profile which has fields with user_Id and regNo and I want to check first if id and email are already exists before proceed to inserting datas. In my codes, I am able to validate only one row (either id or reg number), but if I am going to validate the two of them, it gives me an error, saying "Must declare the scalar variable @userid". I dont know if it is with my select that is wrong or something in my codes
SqlConnection con = new SqlConnection("Data Source=GATE-PCSQLEXPRESS;Initial Catalog=dbProfile;Integrated Security=True"); con.Open(); SqlCommand cmdd = new SqlCommand("select * from Profile where user_Id = @userid AND RegNo = @reg", con); SqlParameter param = new SqlParameter();
How to validate the data if the data already exist in the table record in c#?
For example I wanted to add the student roll no. if roll no. is 134 and if we are adding rollno. 134 student then we get the warning like roll no. 134 is already exist ....
I want to set the rootpath of an executable application. This rootpath should be the same as the path of an item that I select from a ListBox. The code for selecting the item is as follows.
namespace Menu { public partial class Form1 : Form { private Button button; private ListBox listBox1; private string selecteditem;
[Code] ....
Now what I want is: Whatever I get the output as in the :
Console.Writeline(path + selecteditem),
I would want to set this as a rootpath for an application so as to do rest of the measurements or steps only in that path/folder. Is it possible to do something like this?
I have a dynamic storage class based on a vector. The elements of this class shall be addressable via a string.
I have something like the following:
StorageClass* test = new StorageClass(); while(notEnd) { test->setValue("name3", 3); test->setValue("name2", 4);
[Code] ....
The Storage class is implement with a vector having to attributes per entry, the first one is name the second one is value. If the setValue function is called, Igo through the whole vector to find the correct item via the name and than i set the new value.
At the end of the loop i want to write out the data into a comma separated value file (*.csv). This shall be done generic by the writeLineToFile() function of the StorageClass.
As a want the columns in csv file to be sorted in a specific way a thought about a preInitalisation routine at the beginning of the program which builds a the vector with all possible entries as something like this in order to define a specific output order.
I now have 2 places in the code where i write down the "fieldnames".
I was wondering if there is a possibility to check if the fields called by the setValue function were first aranged in the vector by the assigned() function before or bettwer while compiling the programm.
I thought about MAKROS with #define XYZ and #ifndef XYZ #error to do though, but currently i reached a dead end and find no solution for my problem.
I have to check whether or not a record exists in a join and if not ignore that user but still load all the other information for that user
var db = Simple.Data.Database.OpenNamedConnection("sqlConn"); var expr1 = db.PON_APP_USERS.STATUS == 1; var sUsers = db.PON_APP_USERS.FindAll(expr1) .Select( db.PON_APP_USERS.USERKEY, db.PON_APP_USERS.LAST_NAME, db.PON_APP_USERS.FIRST_NAME,
I have two menu items. When item 1 is disabled, I want item 2 to be disabled as well. In the OnUpdate handler of menu item 1, I have tried to use "t_pMenu = pCmdUI->m_pMenu;", "t_pMenu = pCmdUI->m_pSubMenu;" and "t_pMenu = pCmdUI->m_pParentMenu;" but I always get NULL t_pMenu. How can I achieve this purpose?
I've sometimes encountered unexpected runtime issues caused by unsigned values being decremented below zero.
Example 1: "unsigned_value += negative_integer_value;" Example 2: "for( size_t i = size - 1; i >= 0; --i )"
My compiler doesn't provide any compile-time or run-time warnings.
As far as I know, it's not possible to overload operators of primitive data types to check if the unsigned value is decremented below zero.
Any clever strategy to trace such cases at debug runtime, without having to add asserts all over the code? It's important that it does not affect performance in release mode.
For the following program, I'd like to make sure the user input is between 1 and 40 characters. To do this, how would I complete the if statement below?
Code: char p_input[41]; printf("Enter a name (1-40 characters):"); fgets(p_input, 41, stdin);
Im having trouble with the while loop, this program should ask the user for their name, if incorrect it should send an error msg and ask for input again...after the correct name is entered the program should prompt the user to enter a password, again if incorrect it should send an error msg and ask for input again.
the code below does what it should when asking for a name..HOWEVER it does not allow the user to enter a password and instead jumps straight to the error msg..
#include<iostream> #include<string> #include<iomanip> using namespace std; int main() { // Variables string username; string password;
[Code] .....
After the correct name is entered, the program displays this:
"Welcome, Sadia Rajput." "To continue, enter your password: That is incorrect, enter password: "
I would prefer to do this using the while loops and not bool statements
I am trying to build a employee management system using C, and I have done alot so far. Everything seems to work fine, but then I thought that I should let the user store the data of their employees permanently, therefore I created a file and then I store the user's given data in the txt file.
But there is some problem, and I don't seem to understand what is the problem in the code, it's just that whenever the user enters any id to search, and presses any key then nothing appears just a blank screen! I wanted to know that how can I check the ID from the text file and then display the details of the employee of that id!
I'm having a problem with the two while statements in my UDF.
- 1. It will run both while loops twice...?
- 2. It now goes into a continuous loop.
- 3. When it did work, it would only return 1 value to the main()...?
#include <iostream> // for use of "cin" & "cout", endl... #include <iomanip> // for formatting setw function #include <cmath> // for the general math computations #include <string> // for creating descriptive strings #include <sstream> // used to convert a string to an integer //user defined function int userValue (int);
What the code below is not doing is returning a value for item to my variables (item1, item2, etc..) I'm not sure how I can make a function prototype that will ask for input and basically recycle after going through the program to a new value for each item. I also need to input individual tax for each item. I will also post it in this message:
I'm having a problem with removing an item from a queue. At first in the debugger I got SIGTRAP but I don't get it anymore but the problem still exists. When you try to remove an item from the queue the first nothing happens. Here's the code below compile it and you see what I'm talking about.
How can I get the items from a list into textboxes. I am doing an windows form application in visual studio.
I have the first form with a couple of textboxes.
I want the inputs be saved in a list. And then displayed in another form. How to move on. The class with the list looks like this:
public class Casecs { public List<caseInformation> fallInformation = new List<caseInformation>(); public class caseInformation { public string caseId { get; set; } public string phoneNumber { get; set; } public string description { get; set; } }
Then the form with the inputs in textboxes looks like this:
Then where I am stuck a form with some textboxes where I want the list items to be displayed:
public partial class btnDispatch : Form { public btnDispatch() { } public btnDispatch(List<Casecs.caseInformation> fallInformation) { InitializeComponent();
I have a C# WPF program that takes a SQL query and populates a column from an Oracle database into a listbox on the form. I would like to be able to compare all items populated in the listbox, and run a SQL query for each item, populating those values into a different listbox.
So far, I have this code:
string sql2 = "select unique apps.fnd_application_all_view.application_name, fnd_responsibility_vl.responsibility_name, fnd_form_functions_tl.user_function_name, fnd_form_functions.function_name, fnd_form_functions_tl.description, fnd_form_functions.type FROM fnd_compiled_menu_functions, fnd_form_functions, fnd_form_functions_tl, fnd_responsibility, fnd responsibility_vl, apps.fnd_application_all_view WHERE
[code]....
I would like to be able to basically take the "Responsibility_Name" value from the first listbox (lstResponsibilities), which is already populated, and use those values to in the "sql2" query to find the "Function_Name" and populate "Function_Name" in the second listbox (lstFunctions).
template <typename T> void insert(BTree<T>* tree, T item) { if (tree == nullptr) { tree = new BTree<T>(item); } else if (item < tree->val) { insert(tree->left, item); } else { insert(tree->right, item); } }
I think this function may not be working because I am modifying `tree`, which is a local variable. How do I actually modify the current pointer that `tree` represents, not just `nullptr`?
I have ploughed through the exchanges in all the forums, yet I still cannot make it work. The following is a tiny Code::Blocks program, written to isolate the problem:
case ID_ENABLE is similar to case ID_DISABLE above, and neither works. case ID_MESSAGE and case ID_EXIT both works as expected.I have tinkered with EnableMenuItem(), but without success.
I'm creating a roguelike/ cave exploration game, and I've created a lot of it, but I am having problems with item creation. The item is supposed to be the '*'. I know what the problem is (I'm setting Dmap to map after creating the item, but before outputting Dmap), but I don't know how to fix it.Also, I don't really know how code optimization works.I'll split my code between this post and the comments: