L
LuvinLunch
Hi,
I'm converting a system I wrote from vb6 to vb.net and I'm on day 2
using vb.net so apologies if my approach is ridiculous and I'm
grateful for any advice.
I retrieve data from a stored procedure and load it into a
datagridview using the fill function. Once the datagridview is loaded
I call a function to modify some of the fields. I'm basically
replicating the behaviour of my vb6 application. So I call
ModifyDataGrid. In ModifyDataGrid I look at the value in one column.
If it's >1 I want to put a * beside the number in the column before.
Code below if it helps.
If DG.Columns(OFFICEM2COUNT_COL).ValueType.ToString > CStr
(1) Then
DG_MAItems.CurrentCell = DG_MAItems(OFFICEM2_COL, 3)
DG_MAItems.BeginEdit(1)
'DG_MAItems.CurrentCell.Value = builder.Append
(DG_MAItems.CurrentCell.Value.ToString, "*")
DG_MAItems.EndEdit()
End If
The field that I take back from the db is an integer and when I try to
add a * to an integer the compiler is understandably not having it.
So my questions are:
1. If I try to change the value in the integer column from 4 to 4* am
I changing something in the database? I used a data adapter and
dataset to load information. Code below.
Dim da As SqlDataAdapter = New SqlDataAdapter
da.SelectCommand = cmd ' Execute the command
Dim ds As DataSet = New DataSet
da.Fill(ds, "Results")
2. I'm confused about data types. VB6 let me away with such happy
but sloppy messing with data types. How should I convert the integer
in the column so that I can append a * to it?
Thanks for any help.
LL
I'm converting a system I wrote from vb6 to vb.net and I'm on day 2
using vb.net so apologies if my approach is ridiculous and I'm
grateful for any advice.
I retrieve data from a stored procedure and load it into a
datagridview using the fill function. Once the datagridview is loaded
I call a function to modify some of the fields. I'm basically
replicating the behaviour of my vb6 application. So I call
ModifyDataGrid. In ModifyDataGrid I look at the value in one column.
If it's >1 I want to put a * beside the number in the column before.
Code below if it helps.
If DG.Columns(OFFICEM2COUNT_COL).ValueType.ToString > CStr
(1) Then
DG_MAItems.CurrentCell = DG_MAItems(OFFICEM2_COL, 3)
DG_MAItems.BeginEdit(1)
'DG_MAItems.CurrentCell.Value = builder.Append
(DG_MAItems.CurrentCell.Value.ToString, "*")
DG_MAItems.EndEdit()
End If
The field that I take back from the db is an integer and when I try to
add a * to an integer the compiler is understandably not having it.
So my questions are:
1. If I try to change the value in the integer column from 4 to 4* am
I changing something in the database? I used a data adapter and
dataset to load information. Code below.
Dim da As SqlDataAdapter = New SqlDataAdapter
da.SelectCommand = cmd ' Execute the command
Dim ds As DataSet = New DataSet
da.Fill(ds, "Results")
2. I'm confused about data types. VB6 let me away with such happy
but sloppy messing with data types. How should I convert the integer
in the column so that I can append a * to it?
Thanks for any help.
LL