Hi. I need help. I am getting this error saying input string was not in a correct format. couldn't store <> in price column. expect type is decimal.
Here is my code below
[code=vbnet]
Dim connectionStrin g = "DRIVER=Cli ent Access ODBC Driver (32-bit);UID=ODBC;P WD=xxxxxxxxxxxx xxxx;System=XXX .XXX.XXX.XXX"
Dim Order As Integer
Order = CInt(txtOrderNu mber.Text)
Dim sql As String
Dim myconnection As OdbcConnection
Dim myCommand As OdbcDataAdapter
myconnection = New OdbcConnection( connectionStrin g)
myCommand = New OdbcDataAdapter (sql, myconnection)
sql = "select line#, ordno, quano, quana, quans, c2rdt, unitm, prdno, actsp from rmsfiles2.obcop 200 where ordno = " & Order.ToString( )
Dim newtable As New DataTable()
newtable.Column s.Add("Line#", GetType(Integer ))
newtable.Column s.Add("Quano", GetType(Decimal ))
newtable.Column s.Add("Actsp", GetType(Decimal ))
newtable.Column s.Add("Prdno", GetType(Integer ))
newtable.Column s("Line#").Auto Increment = True
For i As Integer = 1 To 10
Dim newrow As DataRow = newtable.NewRow ()
'newrow("Quano" ) = ""
newrow("ACTSP") = ""
newrow("Ordno") = ""
newtable.Rows.A dd(newrow)
Next
gridview1.DataS ource = newtable
gridview1.DataB ind()
[/code]
Here is my code below
[code=vbnet]
Dim connectionStrin g = "DRIVER=Cli ent Access ODBC Driver (32-bit);UID=ODBC;P WD=xxxxxxxxxxxx xxxx;System=XXX .XXX.XXX.XXX"
Dim Order As Integer
Order = CInt(txtOrderNu mber.Text)
Dim sql As String
Dim myconnection As OdbcConnection
Dim myCommand As OdbcDataAdapter
myconnection = New OdbcConnection( connectionStrin g)
myCommand = New OdbcDataAdapter (sql, myconnection)
sql = "select line#, ordno, quano, quana, quans, c2rdt, unitm, prdno, actsp from rmsfiles2.obcop 200 where ordno = " & Order.ToString( )
Dim newtable As New DataTable()
newtable.Column s.Add("Line#", GetType(Integer ))
newtable.Column s.Add("Quano", GetType(Decimal ))
newtable.Column s.Add("Actsp", GetType(Decimal ))
newtable.Column s.Add("Prdno", GetType(Integer ))
newtable.Column s("Line#").Auto Increment = True
For i As Integer = 1 To 10
Dim newrow As DataRow = newtable.NewRow ()
'newrow("Quano" ) = ""
newrow("ACTSP") = ""
newrow("Ordno") = ""
newtable.Rows.A dd(newrow)
Next
gridview1.DataS ource = newtable
gridview1.DataB ind()
[/code]
Comment