| | |
Datatable and datarow.
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2008
Posts: 22
Reputation:
Solved Threads: 0
Doing a small project in which data from warranty cards are entered into a database ie. warranty card number, salesman name and ID, etc etc......after all the data has been entered into the database I need to check and see if there are any duplicate warranty card numbers in the database.
The way I am thinking is that ill first load the table into a dataset and datatable and then loop through all the records using the datarow object. compare each each record with all the other records and if i find a duplicate ill probably set a flag to make both invalid. I understand the concept but i am not too comfortable using all these objects ie datatable, datarow. It would be great if you could give me a simple syntax on how to loop through all the records using a datarow object.
The way I am thinking is that ill first load the table into a dataset and datatable and then loop through all the records using the datarow object. compare each each record with all the other records and if i find a duplicate ill probably set a flag to make both invalid. I understand the concept but i am not too comfortable using all these objects ie datatable, datarow. It would be great if you could give me a simple syntax on how to loop through all the records using a datarow object.
•
•
Join Date: Nov 2008
Posts: 4
Reputation:
Solved Threads: 0
Dear Friend
I can not accept Your procedure .
I think you should check it before entering the syatem.
Check it before entering the system.
Suppose your dataset is ds;
dim count as integer
count=o
while (count < ds.rows.coun)
if ("Code is here"=ds.rows(count).ItemArray("Colomn No from table")
msgbox "Duplicate data"
else
end if
end while
Try it ...................
I can not accept Your procedure .
I think you should check it before entering the syatem.
Check it before entering the system.
Suppose your dataset is ds;
dim count as integer
count=o
while (count < ds.rows.coun)
if ("Code is here"=ds.rows(count).ItemArray("Colomn No from table")
msgbox "Duplicate data"
else
end if
end while
Try it ...................
•
•
Join Date: Sep 2008
Posts: 22
Reputation:
Solved Threads: 0
thanx guys............well the problem is, its not a new project.........some other programmer has already created the database and entered a lot of data ......so, im trying to use the same database.......
Well from the information ive got , the company wishes to have duplicate data. I guess because they are not sure which data is legitimate......Well, at the end of it i need to check for duplicates after the data is entered.......No choice guys......
So getting back to the problem as i mentioned before .... I think i would use the code you gave me above as follows:
Do you think this would work??........Any other ideas?? All this because if there are duplicates I have set the record as duplicate but i need it to be present in the database.
Thnx again guys. Appreciate it.
Well from the information ive got , the company wishes to have duplicate data. I guess because they are not sure which data is legitimate......Well, at the end of it i need to check for duplicates after the data is entered.......No choice guys......
So getting back to the problem as i mentioned before .... I think i would use the code you gave me above as follows:
VB.NET Syntax (Toggle Plain Text)
for(count = 0;count < ds.rows.count;count++) for(count1 = 0;count<ds.rows.count;count1++) if (ds.rows.(count1).ItemArray("coulmn No from table")=ds.rows(count).ItemArray("Colomn No from table") "What ever action to be taken" else end if
Do you think this would work??........Any other ideas?? All this because if there are duplicates I have set the record as duplicate but i need it to be present in the database.
Thnx again guys. Appreciate it.
![]() |
Similar Threads
- Data from datatable after datagrid sorting (VB.NET)
- SQL, Dataview, DataTable and DataAdapter.Update (VB.NET)
- Export DataTable to Excel with variable number of fields (VB.NET)
- DataTable To CSV Don't have a clue (Visual Basic 4 / 5 / 6)
- Trouble adding new row to DataTable (C#) (C#)
- DataTable (ASP.NET)
Other Threads in the VB.NET Forum
- Previous Thread: How to get infor from SQL database in vb
- Next Thread: database connection for sql server 5.0 and vb.net
| Thread Tools | Search this Thread |
"crystal .net .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons center click code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic dosconsolevb.net eclipse editvb.net employees excel exists firewall forms html images isnumericfuntioncall listview map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity open pan pdf picturebox picturebox2 port print printpreview record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure temp textbox timer timespan transparency txttoxmlconverter upload useraccounts usercontol vb vb.net vb.nettoolboxvisualbasic2008sidebar vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web wpf wrapingcode xml





