Setting the datatype of a new column in a dataset

G

Guest

Hello,
I have added a new row to a dataset as follows:

MyMasterTable.Columns.Add("Total")

Even though I convert it's value to decimal using ctype, it is not displayed using the £ symbol in my bound grid.
I have the format of the specified column set to "c2" in the grid also.

Even when I look at the value that is in the dataset for this column it says 1.00 string.
How can I set the datatype of this column to decimal??

Regards

Geri
 
K

Ken Tucker [MVP]

Hi,

I would make the column the decimal type to begin with.

Dim dc As New DataColumn("Total", GetType(Decimal))

MyMasterTable.Columns.Add(dc)


Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top