I’m new to using datasets in VB and I’ve been unable to find guidance on achieving the following:
Some descriptions in the dataset are too long, is there a way to take the first 10 characters of a description?
I’ve tried using:
dataSet.Tables("statement-data").Rows(0).Item(1) = Left(dataSet.Tables("statement-data").Rows(1).Item(1).ToString)
But I get a “Public Property Left As Integer has no parameters and its return type cannot be indexed” error
Example Data
Dataset Table: statement-data
Date Description Debit/Credit Amount
01122012 Computer Equipment for North Office D 1000.00
01122012 Coffee D 25.68
02122012 Payment for Service C 1500.00
If anyone can help, or point me towards any good websites/guidance, that would be awesome.
Thanks
Martyn
The reason you are getting this error is that your code is in a form (or user control).
System.Windows.Forms.Formhas aLeftproperty, so yourLeftis referring toForm.Leftinstead ofMicrosoft.VisualBasic.Strings.Left. To get past the error, you can:Leftmethod withMicrosoft.VisualBasic.Strings.LeftSubstringmethod insteadForm‘s properties won’t conflict with it