Click here to Skip to main content
15,906,301 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi. I need help regarding my small project..i have made a database in access in which i have 10 fields. I have placed 10 textboxes in my c# windows form and there i have to enter the values in each text box as 0 and 1 and these values are to be verified with that database contents as i have already made the connection string. But i am struck that how I am going to verify each textbox's value with the value stored in the field of database table.
Can anyone help??

Thnx
Posted
Comments
Shanu2rick 12-Mar-13 3:43am    
what have you tried?
Shubham Choudhary 12-Mar-13 4:03am    
question is not clear!!!! make clear

Write a select query to retrieve all the records from the tables.
Then run a loop and compare these records against what has been entered in the textbox.
 
Share this answer
 
I have tried a query to search but it dint work out.
 
Share this answer
 
If u may kindly give me a simple example???
 
Share this answer
 
Can anyone also help in improving this code.
clc
a1=[1 -1 1 -1 0 1 1 -1 1 -1 0 1 1 -1 1 -1];
a2=[1 -1 1 -1 1 1 1 -1 1 -1 0 1 1 -1 -1 -1];
a=[a1;a2];
[x,y]=size(a);
b=input('Enter:');
[l,m]=size(b);
count=0;
if(y==m)
for i = 1:x
for j = 1:y
if(b(j)==a(j))
count=count+1;
per=(count*100)/y;
end
if(per<81.25)
i = i+1;
end
end
end
if(per==100||per==93.75||per==87.5||per==81.25)
disp('Vector matched');
else
disp('Not matched')
end
else
disp('Execute program again');

end

The problem is its only checking the first vector not the rest so can anyone help with this, its in matlab.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900