o-mheien@hdsoftware.no
Active member
- Joined
- Feb 6, 2007
- Messages
- 27
- Programming Experience
- 10+
Hi folks
I'm kind of new to VB.NET and the usage of SQL. In My past I have been working with a DEV tool called Clarion. Whats nice with Clarion is the Database access engine, wich I like wery much. Reason to move on to VB.net is that Clarion dont have .NET support and probably wil not have it in a long time. Som here is what I nead to know how to do
I nead to know how to access data files and how to update records etc... I'l give a couple of examples here and if some of you nice guys wil give the VB.NET version of the exactly same code, I would really appreciate it.
Ok, here goes:
1. Access a record, do some change and then update it:
2. Update some records based on a filter and allso delete some
I'm kind of new to VB.NET and the usage of SQL. In My past I have been working with a DEV tool called Clarion. Whats nice with Clarion is the Database access engine, wich I like wery much. Reason to move on to VB.net is that Clarion dont have .NET support and probably wil not have it in a long time. Som here is what I nead to know how to do
I nead to know how to access data files and how to update records etc... I'l give a couple of examples here and if some of you nice guys wil give the VB.NET version of the exactly same code, I would really appreciate it.
Ok, here goes:
1. Access a record, do some change and then update it:
VB.NET:
CustomerFile.CustomerID = 1234
Get(CustomerFile, CustomerFile.CustomerID)
if errorcode()
Message('Record 1234 doesnt exist')
Else
CustomerFile.LastVisited = Today()
Put(CustomerFile)
End!if
2. Update some records based on a filter and allso delete some
VB.NET:
Clear(CustomerFile)
CustomerFile.LastVisitedDate = SomeDate
Set(CustomerFile.VisitDate)
Loop until EOF(CustomerFile)
Next(CustomerFile)
if CustomerFile.LastVisitedDate > SomeOtherDate then break.
if CustomerFile.OrderTotal < 100000 then cycle.
if CustomerFile.IsToBeDeleted = True
Delete(CustomerFile)
Cycle
End!if
CustomerFile.Discount = 20
Put(CustomerFile)
End!Loop